Format watcher module

This commit is contained in:
thePR0M3TH3AN
2025-05-22 17:49:56 -04:00
parent 1c68e15fd2
commit 84d5e04ce7

View File

@@ -520,15 +520,16 @@ impl FileWatcher {
let _ = h.join();
}
*self
.state
.lock()
.map_err(|_| anyhow::anyhow!("state"))? = WatcherState::Stopped;
*self.state.lock().map_err(|_| anyhow::anyhow!("state"))? = WatcherState::Stopped;
Ok(())
}
pub fn status(&self) -> Result<WatcherStatus> {
let st = self.state.lock().map_err(|_| anyhow::anyhow!("state"))?.clone();
let st = self
.state
.lock()
.map_err(|_| anyhow::anyhow!("state"))?
.clone();
Ok(WatcherStatus {
state: st,
events_processed: self.events_processed.load(Ordering::SeqCst),