fix recursive watch

This commit is contained in:
Bernardo 2019-01-21 21:48:07 +01:00 committed by Aleksey Kladov
parent 2a1afad3ed
commit eeed6cf53b

View File

@ -91,9 +91,14 @@ pub fn watch_recursive(&mut self, dir: &Path, filter: &RootFilter, emit_for_cont
match res {
Ok(entry) => {
if entry.path().is_dir() {
match self.watcher.watch(dir, RecursiveMode::NonRecursive) {
Ok(()) => log::debug!("watching \"{}\"", dir.display()),
Err(e) => log::warn!("could not watch \"{}\": {}", dir.display(), e),
match self
.watcher
.watch(entry.path(), RecursiveMode::NonRecursive)
{
Ok(()) => log::debug!("watching \"{}\"", entry.path().display()),
Err(e) => {
log::warn!("could not watch \"{}\": {}", entry.path().display(), e)
}
}
}
if emit_for_contents && entry.depth() > 0 {