diff --git a/src/network.rs b/src/network.rs index 1b5eafd..c95d239 100644 --- a/src/network.rs +++ b/src/network.rs @@ -389,7 +389,7 @@ impl NetworkProcessor { ) { loop { let now = Instant::now(); - self.process_poll_event(Some(timeout), |e| event_callback(e)); + self.process_poll_event(Some(timeout), &mut event_callback); if now.elapsed() > timeout { break } diff --git a/src/network/poll.rs b/src/network/poll.rs index 6119af2..83578f6 100644 --- a/src/network/poll.rs +++ b/src/network/poll.rs @@ -83,7 +83,7 @@ impl Poll { break } Err(ref err) if err.kind() == ErrorKind::Interrupted => continue, - Err(ref err) => Err(err).expect("No error here"), + Err(ref err) => panic!("{}: No error here", err), } } }