Merge pull request #21 from frewsxcv/clippy

Address a few clippy suggestions.
This commit is contained in:
Alex Crichton
2016-09-07 21:19:40 -07:00
committed by GitHub
2 changed files with 5 additions and 9 deletions
+2 -6
View File
@@ -356,11 +356,7 @@ impl Loop {
}
fn consume_timeouts(&mut self, now: Instant) {
loop {
let idx = match self.timer_wheel.borrow_mut().poll(now) {
Some(idx) => idx,
None => break,
};
while let Some(idx) = self.timer_wheel.borrow_mut().poll(now) {
trace!("firing timeout: {}", idx);
let handle = self.timeouts.borrow_mut()[idx].1.fire();
if let Some(handle) = handle {
@@ -496,7 +492,7 @@ impl Loop {
Message::AddTimeout(at, slot) => {
slot.try_produce(self.add_timeout(at))
.ok().expect("interference with try_produce on timeout");
.expect("interference with try_produce on timeout");
}
Message::UpdateTimeout(t, handle) => self.update_timeout(t, handle),
Message::CancelTimeout(t) => self.cancel_timeout(t),
+3 -3
View File
@@ -393,7 +393,7 @@ impl<'a> Read for &'a TcpStream {
if is_wouldblock(&r) {
self.io.need_read();
}
return r
r
}
}
@@ -406,7 +406,7 @@ impl<'a> Write for &'a TcpStream {
if is_wouldblock(&r) {
self.io.need_write();
}
return r
r
}
fn flush(&mut self) -> io::Result<()> {
@@ -417,7 +417,7 @@ impl<'a> Write for &'a TcpStream {
if is_wouldblock(&r) {
self.io.need_write();
}
return r
r
}
}