mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
chore: use ready macro from futures-core (#1300)
This commit is contained in:
committed by
Carl Lerche
parent
ca708d6d87
commit
83273b8b50
@@ -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};
|
||||
|
||||
@@ -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,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};
|
||||
|
||||
@@ -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,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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user