fix:can't rewatch a directory that has been deleted once before (#1313)

Fix minor errors
This commit is contained in:
leihaojun 2024-07-24 17:32:57 +08:00
parent 4a0522640d
commit 1fd452f6b6

View file

@ -72,7 +72,7 @@ impl Watcher {
(old.difference(new).cloned().collect(), new.difference(old).cloned().collect())
};
to_unwatch.retain(|u| watcher.unwatch(u).is_ok());
to_unwatch.retain(|u| watcher.unwatch(u).is_ok() || !u.exists());
to_watch.retain(|u| watcher.watch(u, RecursiveMode::NonRecursive).is_ok());
{