Browse Source

error was handled twice

master
Milan 2 years ago
parent
commit
90edd5cbfa
  1. 18
      src/main.rs

18
src/main.rs

@ -62,17 +62,13 @@ impl Indexer {
}
fn handle_notify(self: Indexer, res: notify::Result<Event>) -> Result<()> {
match res {
Ok(event) => {
// println!("event: {:?}", event);
match event.kind {
EventKind::Create(_) => self.mark_as_dirty(event.paths),
EventKind::Modify(_) => self.mark_as_dirty(event.paths),
EventKind::Remove(_) => self.mark_as_dirty(event.paths),
_ => Ok(()),
}?;
},
Err(e) => println!("watch error: {:?}", e),
let event = res?;
match event.kind {
EventKind::Create(_) => self.mark_as_dirty(event.paths)?,
EventKind::Modify(_) => self.mark_as_dirty(event.paths)?,
EventKind::Remove(_) => self.mark_as_dirty(event.paths)?,
_ => (),
};
Ok(())

Loading…
Cancel
Save