diff options
Diffstat (limited to 'tokio/src/util')
-rw-r--r-- | tokio/src/util/future.rs | 35 | ||||
-rw-r--r-- | tokio/src/util/mod.rs | 6 | ||||
-rw-r--r-- | tokio/src/util/stream.rs | 2 |
3 files changed, 7 insertions, 36 deletions
diff --git a/tokio/src/util/future.rs b/tokio/src/util/future.rs index ea9d0ff3..a5fb70a0 100644 --- a/tokio/src/util/future.rs +++ b/tokio/src/util/future.rs @@ -1,14 +1,10 @@ -use futures::Future; - -#[cfg(feature = "timer")] -#[allow(deprecated)] -use tokio_timer::Deadline; - #[cfg(feature = "timer")] use tokio_timer::Timeout; #[cfg(feature = "timer")] -use std::time::{Duration, Instant}; +use std::time::Duration; + +use std::future::Future; /// An extension trait for `Future` that provides a variety of convenient /// combinator functions. @@ -62,31 +58,6 @@ pub trait FutureExt: Future { { Timeout::new(self, timeout) } - - #[cfg(feature = "timer")] - #[deprecated(since = "0.1.8", note = "use `timeout` instead")] - #[allow(deprecated)] - #[doc(hidden)] - fn deadline(self, deadline: Instant) -> Deadline<Self> - where - Self: Sized, - { - Deadline::new(self, deadline) - } } impl<T: ?Sized> FutureExt for T where T: Future {} - -#[cfg(test)] -mod test { - use super::*; - use crate::prelude::future; - - #[cfg(feature = "timer")] - #[test] - fn timeout_polls_at_least_once() { - let base_future = future::result::<(), ()>(Ok(())); - let timeouted_future = base_future.timeout(Duration::new(0, 0)); - assert!(timeouted_future.wait().is_ok()); - } -} diff --git a/tokio/src/util/mod.rs b/tokio/src/util/mod.rs index 58fd3d0b..3a9ec31f 100644 --- a/tokio/src/util/mod.rs +++ b/tokio/src/util/mod.rs @@ -7,9 +7,9 @@ //! [`FutureExt`]: trait.FutureExt.html //! [`StreamExt`]: trait.StreamExt.html -mod enumerate; +// mod enumerate; mod future; -mod stream; +// mod stream; pub use self::future::FutureExt; -pub use self::stream::StreamExt; +// pub use self::stream::StreamExt; diff --git a/tokio/src/util/stream.rs b/tokio/src/util/stream.rs index 9b2d0852..001a4496 100644 --- a/tokio/src/util/stream.rs +++ b/tokio/src/util/stream.rs @@ -1,8 +1,8 @@ pub use crate::util::enumerate::Enumerate; -use futures::Stream; #[cfg(feature = "timer")] use std::time::Duration; + #[cfg(feature = "timer")] use tokio_timer::{throttle::Throttle, Timeout}; |