chore: use ready macro from futures-core (#1300)

This commit is contained in:
Gurwinder Singh
2019-07-15 10:43:54 -07:00
committed by Carl Lerche
parent ca708d6d87
commit 83273b8b50
48 changed files with 42 additions and 137 deletions
+2 -2
View File
@@ -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"
+1
View File
@@ -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};
+1
View File
@@ -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;
+1
View File
@@ -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};
-9
View File
@@ -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")]
+1
View File
@@ -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,
+2
View File
@@ -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;