Unwatch paths when they're reported as removed

This commit is contained in:
Lucien Greathouse
2020-02-19 23:32:46 -08:00
parent 3a029caf2b
commit 00a29bb6be

View File

@@ -147,8 +147,14 @@ impl VfsLock {
self.backend.event_receiver()
}
pub fn commit_event(&mut self, _event: &VfsEvent) -> io::Result<()> {
// Because we hold no state, there's no cache to update here.
pub fn commit_event(&mut self, event: &VfsEvent) -> io::Result<()> {
match event {
VfsEvent::Remove(path) => {
let _ = self.backend.unwatch(&path);
}
_ => {}
}
Ok(())
}
}