Skip to content

Commit

Permalink
Fix 850ff40
Browse files Browse the repository at this point in the history
With 850ff40 I introduced a bug,
when a path couldn't be found the watcher wasn't started again. This
should fix issue notify-rs#105 correctly.
  • Loading branch information
Neo committed Jan 22, 2017
1 parent 1674bfa commit eef7782
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/fsevent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,10 @@ impl Watcher for FsEventWatcher {

fn watch<P: AsRef<Path>>(&mut self, path: P, recursive_mode: RecursiveMode) -> Result<()> {
self.stop();
try!(self.append_path(path, recursive_mode));
self.run()
let result = self.append_path(path, recursive_mode);
// ignore return error: may be empty path list
let _ = self.run();
result
}

fn unwatch<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
Expand Down

0 comments on commit eef7782

Please sign in to comment.