summaryrefslogtreecommitdiffstats
path: root/tokio-timer
diff options
context:
space:
mode:
authorGurwinder Singh <vargwin@gmail.com>2019-07-15 23:13:54 +0530
committerCarl Lerche <me@carllerche.com>2019-07-15 10:43:54 -0700
commit83273b8b50fd4e7a68c83f9086e2f1bd513174d7 (patch)
tree904db56e391293e4ddf40e326a514ddb98d7b7c4 /tokio-timer
parentca708d6d8783b4fc86ccc059fb7a40e14edfe812 (diff)
chore: use ready macro from `futures-core` (#1300)
Diffstat (limited to 'tokio-timer')
-rw-r--r--tokio-timer/Cargo.toml4
-rw-r--r--tokio-timer/src/delay.rs1
-rw-r--r--tokio-timer/src/delay_queue.rs1
-rw-r--r--tokio-timer/src/interval.rs1
-rw-r--r--tokio-timer/src/lib.rs9
-rw-r--r--tokio-timer/src/throttle.rs1
-rw-r--r--tokio-timer/src/timeout.rs2
7 files changed, 8 insertions, 11 deletions
diff --git a/tokio-timer/Cargo.toml b/tokio-timer/Cargo.toml
index e6e5853a..5cdbaa49 100644
--- a/tokio-timer/Cargo.toml
+++ b/tokio-timer/Cargo.toml
@@ -22,18 +22,18 @@ Timer facilities for Tokio
publish = false
[features]
-async-traits = ["futures-core-preview"]
+async-traits = []
[dependencies]
tokio-executor = { version = "0.2.0", path = "../tokio-executor" }
tokio-sync = { version = "0.2.0", path = "../tokio-sync" }
+futures-core-preview = "0.3.0-alpha.17"
async-util = { git = "https://github.com/tokio-rs/async" }
crossbeam-utils = "0.6.0"
# Backs `DelayQueue`
slab = "0.4.1"
# optionals
-futures-core-preview = { version = "0.3.0-alpha.17", optional = true }
[dev-dependencies]
rand = "0.7"
diff --git a/tokio-timer/src/delay.rs b/tokio-timer/src/delay.rs
index 7411e071..41210690 100644
--- a/tokio-timer/src/delay.rs
+++ b/tokio-timer/src/delay.rs
@@ -1,4 +1,5 @@
use crate::timer::{HandlePriv, Registration};
+use futures_core::ready;
use std::future::Future;
use std::pin::Pin;
use std::task::{self, Poll};
diff --git a/tokio-timer/src/delay_queue.rs b/tokio-timer/src/delay_queue.rs
index 79b1d29f..d9d0f36c 100644
--- a/tokio-timer/src/delay_queue.rs
+++ b/tokio-timer/src/delay_queue.rs
@@ -9,6 +9,7 @@ use crate::timer::Handle;
use crate::wheel::{self, Wheel};
use crate::{Delay, Error};
+use futures_core::ready;
use slab::Slab;
use std::cmp;
use std::future::Future;
diff --git a/tokio-timer/src/interval.rs b/tokio-timer/src/interval.rs
index e112d07a..f0448640 100644
--- a/tokio-timer/src/interval.rs
+++ b/tokio-timer/src/interval.rs
@@ -1,6 +1,7 @@
use crate::clock;
use crate::Delay;
+use futures_core::ready;
use std::future::Future;
use std::pin::Pin;
use std::task::{self, Poll};
diff --git a/tokio-timer/src/lib.rs b/tokio-timer/src/lib.rs
index 48b9ba00..36449472 100644
--- a/tokio-timer/src/lib.rs
+++ b/tokio-timer/src/lib.rs
@@ -32,15 +32,6 @@
//! [`Interval`]: struct.Interval.html
//! [`Timer`]: timer/struct.Timer.html
-macro_rules! ready {
- ($e:expr) => {
- match $e {
- ::std::task::Poll::Ready(v) => v,
- ::std::task::Poll::Pending => return ::std::task::Poll::Pending,
- }
- };
-}
-
pub mod clock;
pub mod delay_queue;
#[cfg(feature = "async-traits")]
diff --git a/tokio-timer/src/throttle.rs b/tokio-timer/src/throttle.rs
index 494c42cc..dae09320 100644
--- a/tokio-timer/src/throttle.rs
+++ b/tokio-timer/src/throttle.rs
@@ -1,6 +1,7 @@
//! Slow down a stream by enforcing a delay between items.
use crate::{clock, Delay};
+use futures_core::ready;
use futures_core::Stream;
use std::{
future::Future,
diff --git a/tokio-timer/src/timeout.rs b/tokio-timer/src/timeout.rs
index a8ce0d52..18068778 100644
--- a/tokio-timer/src/timeout.rs
+++ b/tokio-timer/src/timeout.rs
@@ -6,6 +6,8 @@
use crate::clock::now;
use crate::Delay;
+#[cfg(feature = "async-traits")]
+use futures_core::ready;
use std::fmt;
use std::future::Future;
use std::pin::Pin;