diff --git a/src/service.rs b/src/service.rs index eaa9ee0..7396b34 100644 --- a/src/service.rs +++ b/src/service.rs @@ -56,7 +56,7 @@ pub struct Service { pub(crate) client_manager: ClientManager, port: Rc>, public_key_fingerprint: String, - notifies: Rc, + frontend_event_pending: Rc, pub(crate) config: Rc, pending_frontend_events: Rc>>, capture_status: Rc>, @@ -69,11 +69,6 @@ pub struct Service { next_trigger_handle: u64, } -#[derive(Default)] -struct Notifies { - frontend_event_pending: Notify, -} - impl Service { pub async fn new(config: Config) -> Result { let client_manager = ClientManager::default(); @@ -106,8 +101,8 @@ impl Service { public_key_fingerprint, config: Rc::new(config), client_manager, + frontend_event_pending: Default::default(), port, - notifies: Default::default(), pending_frontend_events: Rc::new(RefCell::new(VecDeque::new())), capture_status: Default::default(), emulation_status: Default::default(), @@ -222,7 +217,7 @@ impl Service { } } } - _ = self.notifies.frontend_event_pending.notified() => { + _ = self.frontend_event_pending.notified() => { while let Some(event) = { /* need to drop borrow before next iteration! */ let event = self.pending_frontend_events.borrow_mut().pop_front(); @@ -378,7 +373,7 @@ impl Service { fn notify_frontend(&self, event: FrontendEvent) { self.pending_frontend_events.borrow_mut().push_back(event); - self.notifies.frontend_event_pending.notify_one(); + self.frontend_event_pending.notify_one(); } pub(crate) fn client_updated(&self, handle: ClientHandle) {