From def2c047148dc86f397bee52fab9ee58c1779010 Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Fri, 8 Nov 2024 18:21:01 +0100 Subject: [PATCH] remove unnecessary struct --- src/service.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/service.rs b/src/service.rs index eaa9ee00..1d5c589e 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: Notify, 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(); @@ -107,7 +102,6 @@ impl Service { config: Rc::new(config), client_manager, port, - notifies: Default::default(), pending_frontend_events: Rc::new(RefCell::new(VecDeque::new())), capture_status: Default::default(), emulation_status: Default::default(), @@ -222,7 +216,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 +372,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) {