mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-09 00:00:08 +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) {
|
fn consume_timeouts(&mut self, now: Instant) {
|
||||||
loop {
|
while let Some(idx) = self.timer_wheel.borrow_mut().poll(now) {
|
||||||
let idx = match self.timer_wheel.borrow_mut().poll(now) {
|
|
||||||
Some(idx) => idx,
|
|
||||||
None => break,
|
|
||||||
};
|
|
||||||
trace!("firing timeout: {}", idx);
|
trace!("firing timeout: {}", idx);
|
||||||
let handle = self.timeouts.borrow_mut()[idx].1.fire();
|
let handle = self.timeouts.borrow_mut()[idx].1.fire();
|
||||||
if let Some(handle) = handle {
|
if let Some(handle) = handle {
|
||||||
@@ -496,7 +492,7 @@ impl Loop {
|
|||||||
|
|
||||||
Message::AddTimeout(at, slot) => {
|
Message::AddTimeout(at, slot) => {
|
||||||
slot.try_produce(self.add_timeout(at))
|
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::UpdateTimeout(t, handle) => self.update_timeout(t, handle),
|
||||||
Message::CancelTimeout(t) => self.cancel_timeout(t),
|
Message::CancelTimeout(t) => self.cancel_timeout(t),
|
||||||
|
|||||||
+3
-3
@@ -393,7 +393,7 @@ impl<'a> Read for &'a TcpStream {
|
|||||||
if is_wouldblock(&r) {
|
if is_wouldblock(&r) {
|
||||||
self.io.need_read();
|
self.io.need_read();
|
||||||
}
|
}
|
||||||
return r
|
r
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -406,7 +406,7 @@ impl<'a> Write for &'a TcpStream {
|
|||||||
if is_wouldblock(&r) {
|
if is_wouldblock(&r) {
|
||||||
self.io.need_write();
|
self.io.need_write();
|
||||||
}
|
}
|
||||||
return r
|
r
|
||||||
}
|
}
|
||||||
|
|
||||||
fn flush(&mut self) -> io::Result<()> {
|
fn flush(&mut self) -> io::Result<()> {
|
||||||
@@ -417,7 +417,7 @@ impl<'a> Write for &'a TcpStream {
|
|||||||
if is_wouldblock(&r) {
|
if is_wouldblock(&r) {
|
||||||
self.io.need_write();
|
self.io.need_write();
|
||||||
}
|
}
|
||||||
return r
|
r
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user