Use while..let construct for loop.

This commit is contained in:
Corey Farwell 2016-09-07 21:29:37 -04:00
parent 815dc803db
commit 93e1d4778d

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 {