Skip to content

Commit

Permalink
remove unnecessary struct
Browse files Browse the repository at this point in the history
  • Loading branch information
feschber committed Nov 8, 2024
1 parent 7d6a081 commit def2c04
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub struct Service {
pub(crate) client_manager: ClientManager,
port: Rc<Cell<u16>>,
public_key_fingerprint: String,
notifies: Rc<Notifies>,
frontend_event_pending: Notify,
pub(crate) config: Rc<Config>,
pending_frontend_events: Rc<RefCell<VecDeque<FrontendEvent>>>,
capture_status: Rc<Cell<Status>>,
Expand All @@ -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<Self, ServiceError> {
let client_manager = ClientManager::default();
Expand Down Expand Up @@ -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(),
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit def2c04

Please sign in to comment.