diff --git a/lib/src/fs.rs b/lib/src/fs.rs index e6992322..7b2c9925 100644 --- a/lib/src/fs.rs +++ b/lib/src/fs.rs @@ -29,13 +29,13 @@ impl Default for Watcher { } impl Watcher { - fn create(self, f: impl notify::EventFn) -> Result, RuntimeError> { + fn create(self, f: impl notify::EventFn) -> Result, RuntimeError> { match self { Self::Native => { - notify::RecommendedWatcher::new(f).map(|w| Box::new(w) as Box) + notify::RecommendedWatcher::new(f).map(|w| Box::new(w) as _) } Self::Poll => { - notify::PollWatcher::new(f).map(|w| Box::new(w) as Box) + notify::PollWatcher::new(f).map(|w| Box::new(w) as _) } } .map_err(|err| RuntimeError::FsWatcherCreate { kind: self, err }) @@ -90,8 +90,8 @@ pub async fn worker( debug!("launching filesystem worker"); let mut watcher_type = Watcher::default(); - let mut watcher: Option> = None; - let mut pathset: HashSet = HashSet::new(); + let mut watcher = None; + let mut pathset = HashSet::new(); while working.changed().await.is_ok() { // In separate scope so we drop the working read lock as early as we can @@ -187,6 +187,7 @@ pub async fn worker( debug!("ending file watcher"); Ok(()) } + fn process_event( nev: Result, kind: Watcher,