Skip to content

Commit

Permalink
chore: fix question_mark lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhuw committed Mar 23, 2024
1 parent 309672d commit a946882
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/session/watch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,9 @@ impl WatchManager {
}

fn try_remove_watcher(&mut self, watcher_id: WatcherId, depot: &Depot) -> Option<(&str, WatchMode)> {
let Some(path) = self.watching_paths.remove(&watcher_id) else {
return None;
};
let Some(watch) = self.watches.get_mut(path) else {
return None;
};
let Some(watcher) = watch.remove_watcher(watcher_id) else {
return None;
};
let path = self.watching_paths.remove(&watcher_id)?;
let watch = self.watches.get_mut(path)?;
let watcher = watch.remove_watcher(watcher_id)?;
let mut mode = watcher.kind.into_remove_mode();
if watch.is_empty() {
self.remove_watches(path);
Expand Down

0 comments on commit a946882

Please sign in to comment.