mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-19 00:00:09 +02:00
Merge pull request #21 from frewsxcv/clippy
Address a few clippy suggestions.
This commit is contained in:
@@ -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
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user