mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-30 00:00:16 +02:00
Use while..let construct for loop.
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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user