We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b8b3af commit 7559260Copy full SHA for 7559260
timely/src/worker.rs
@@ -415,8 +415,8 @@ impl<A: Allocate> Worker<A> {
415
/// worker.step_while(|| probe.less_than(&0));
416
/// });
417
/// ```
418
- pub fn step_while<F: FnMut()->bool>(&mut self, mut func: F) {
419
- while func() { self.step(); }
+ pub fn step_while<F: FnMut()->bool>(&mut self, func: F) {
+ self.step_or_park_while(Some(Duration::from_secs(0)), func)
420
}
421
422
/// Calls `self.step_or_park(duration)` as long as `func` evaluates to true.
0 commit comments