File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -342,7 +342,6 @@ impl Timer {
342
342
None => {
343
343
// Overflow to never going off.
344
344
self . clear ( ) ;
345
- self . when = None ;
346
345
}
347
346
}
348
347
}
@@ -405,7 +404,6 @@ impl Timer {
405
404
None => {
406
405
// Overflow to never going off.
407
406
self . clear ( ) ;
408
- self . when = None ;
409
407
}
410
408
}
411
409
}
@@ -443,12 +441,13 @@ impl Timer {
443
441
}
444
442
}
445
443
446
- /// Helper function to clear the current timer.
447
- fn clear ( & mut self ) {
444
+ /// Clear any timeouts set on this timer. It will never fire again until a new interval or instant is set .
445
+ pub fn clear ( & mut self ) {
448
446
if let ( Some ( when) , Some ( ( id, _) ) ) = ( self . when , self . id_and_waker . as_ref ( ) ) {
449
447
// Deregister the timer from the reactor.
450
448
Reactor :: get ( ) . remove_timer ( when, * id) ;
451
449
}
450
+ self . when = None ;
452
451
}
453
452
}
454
453
You can’t perform that action at this time.
0 commit comments