Skip to content

Commit

Permalink
Using send_opt instead of send to get rid of a possible panic when
Browse files Browse the repository at this point in the history
running tests
  • Loading branch information
Detegr committed Dec 31, 2014
1 parent 7cdf4b2 commit 0b29c60
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/inotify/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ impl INotifyWatcher {
Err(e) => {
match e.kind {
IoErrorKind::EndOfFile => break,
_ => tx.send(Event {
path: None,
op: Err(Error::Io(e))
})
_ => {
tx.send_opt(Event {
path: None,
op: Err(Error::Io(e))
});
}
}
}
}
Expand Down Expand Up @@ -91,7 +93,7 @@ impl Watcher for INotifyWatcher {
},
Err(e) => return Err(Error::Io(e))
};

it.run();
return Ok(it);
}
Expand Down

0 comments on commit 0b29c60

Please sign in to comment.