diff --git a/tokio/src/runtime/time/wheel/mod.rs b/tokio/src/runtime/time/wheel/mod.rs index c3ba3643305..bf13b7b2415 100644 --- a/tokio/src/runtime/time/wheel/mod.rs +++ b/tokio/src/runtime/time/wheel/mod.rs @@ -148,23 +148,13 @@ impl Wheel { return Some(handle); } - // under what circumstances is poll.expiration Some vs. None? - let expiration = self.next_expiration().and_then(|expiration| { - if expiration.deadline > now { - None - } else { - Some(expiration) - } - }); - - match expiration { - Some(ref expiration) if expiration.deadline > now => return None, - Some(ref expiration) => { + match self.next_expiration() { + Some(ref expiration) if expiration.deadline <= now => { self.process_expiration(expiration); self.set_elapsed(expiration.deadline); } - None => { + _ => { // in this case the poll did not indicate an expiration // _and_ we were not able to find a next expiration in // the current list of timers. advance to the poll's