diff options
author | Carl Lerche <me@carllerche.com> | 2019-05-14 10:27:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-14 10:27:36 -0700 |
commit | cb4aea394e6851ae8cc45a68beeaf2c93cc9a0c0 (patch) | |
tree | 2158eab230c8717d3b35717e50f14fda6ca0edf1 /tokio/src/util | |
parent | 79d88200500f6e6c9970e1ad26469276c1a2f71f (diff) |
Update Tokio to Rust 2018 (#1082)
Diffstat (limited to 'tokio/src/util')
-rw-r--r-- | tokio/src/util/enumerate.rs | 2 | ||||
-rw-r--r-- | tokio/src/util/future.rs | 9 | ||||
-rw-r--r-- | tokio/src/util/stream.rs | 9 |
3 files changed, 8 insertions, 12 deletions
diff --git a/tokio/src/util/enumerate.rs b/tokio/src/util/enumerate.rs index 8f6926fa..a3b91628 100644 --- a/tokio/src/util/enumerate.rs +++ b/tokio/src/util/enumerate.rs @@ -1,4 +1,4 @@ -use futures::{Async, Poll, Sink, StartSend, Stream}; +use futures::{try_ready, Async, Poll, Sink, StartSend, Stream}; /// A stream combinator which combines the yields the current item /// plus its count starting from 0. diff --git a/tokio/src/util/future.rs b/tokio/src/util/future.rs index 5a381810..ea9d0ff3 100644 --- a/tokio/src/util/future.rs +++ b/tokio/src/util/future.rs @@ -1,11 +1,12 @@ +use futures::Future; + #[cfg(feature = "timer")] #[allow(deprecated)] use tokio_timer::Deadline; + #[cfg(feature = "timer")] use tokio_timer::Timeout; -use futures::Future; - #[cfg(feature = "timer")] use std::time::{Duration, Instant}; @@ -38,8 +39,6 @@ pub trait FutureExt: Future { /// # Examples /// /// ``` - /// # extern crate tokio; - /// # extern crate futures; /// use tokio::prelude::*; /// use std::time::Duration; /// # use futures::future::{self, FutureResult}; @@ -81,7 +80,7 @@ impl<T: ?Sized> FutureExt for T where T: Future {} #[cfg(test)] mod test { use super::*; - use prelude::future; + use crate::prelude::future; #[cfg(feature = "timer")] #[test] diff --git a/tokio/src/util/stream.rs b/tokio/src/util/stream.rs index 3b7aa268..9b2d0852 100644 --- a/tokio/src/util/stream.rs +++ b/tokio/src/util/stream.rs @@ -1,11 +1,10 @@ -#[cfg(feature = "timer")] -use tokio_timer::{throttle::Throttle, Timeout}; +pub use crate::util::enumerate::Enumerate; use futures::Stream; - #[cfg(feature = "timer")] use std::time::Duration; -pub use util::enumerate::Enumerate; +#[cfg(feature = "timer")] +use tokio_timer::{throttle::Throttle, Timeout}; /// An extension trait for `Stream` that provides a variety of convenient /// combinator functions. @@ -63,8 +62,6 @@ pub trait StreamExt: Stream { /// # Examples /// /// ``` - /// # extern crate tokio; - /// # extern crate futures; /// use tokio::prelude::*; /// use std::time::Duration; /// # use futures::future::{self, FutureResult}; |