Skip to content

Commit 50c527f

Browse files
committed
tests: update TokioTimer to use downcast methods
1 parent 424e396 commit 50c527f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

benches/support/tokiort.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ impl Timer for TokioTimer {
4141
inner: tokio::time::sleep_until(deadline.into()),
4242
})
4343
}
44+
45+
fn reset(&self, sleep: &mut Pin<Box<dyn Sleep>>, new_deadline: Instant) {
46+
if sleep.downcast_ref::<TokioSleep>().is_some() {
47+
*sleep = self.sleep_until(new_deadline);
48+
}
49+
}
4450
}
4551

4652
struct TokioTimeout<T> {

0 commit comments

Comments
 (0)