From 29f35df7f8953b03327297c7dd4692293f4c72ff Mon Sep 17 00:00:00 2001 From: John-John Tedro Date: Fri, 11 Oct 2019 21:45:44 +0200 Subject: [PATCH] Remove incorrect FusedFuture impl on Delay (#1652) `is_terminated` must return `true` until the future has been polled at least once to make sure that the associated block in select is called even after the delay has elapsed. You use `Delay` in a `select!` by [fusing it](https://docs.rs/futures-preview/0.3.0-alpha.19/futures/future/trait.FutureExt.html#method.fuse): ```rust let delay = tokio::timer::delay(/* ... */); let delay = delay.fuse(); select! { _ = delay => { /* work here */ } } ``` --- tokio-timer/src/delay.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tokio-timer/src/delay.rs b/tokio-timer/src/delay.rs index abeda473c..e613622ae 100644 --- a/tokio-timer/src/delay.rs +++ b/tokio-timer/src/delay.rs @@ -91,13 +91,6 @@ impl Delay { } } -#[cfg(feature = "async-traits")] -impl futures_core::FusedFuture for Delay { - fn is_terminated(&self) -> bool { - self.is_elapsed() - } -} - impl Future for Delay { type Output = ();