Fix RefCell borrow_mut error on firing timeouts

The scope was a little longer than intended!
This commit is contained in:
Alex Crichton
2016-08-05 09:38:41 -07:00
parent 5d0fdf26a9
commit 368a9c70e8
+5 -1
View File
@@ -237,7 +237,11 @@ impl Loop {
}
fn consume_timeouts(&mut self, now: Instant) {
while let Some(idx) = self.timer_wheel.borrow_mut().poll(now) {
loop {
let idx = match self.timer_wheel.borrow_mut().poll(now) {
Some(idx) => idx,
None => break,
};
trace!("firing timeout: {}", idx);
let handle = self.timeouts.borrow_mut()[idx].1.fire();
if let Some(handle) = handle {