diff --git a/tokio-io/Cargo.toml b/tokio-io/Cargo.toml index 8f4204959..2561ac217 100644 --- a/tokio-io/Cargo.toml +++ b/tokio-io/Cargo.toml @@ -24,6 +24,7 @@ publish = false [dependencies] bytes = "0.4.7" log = "0.4" +futures-core-preview = "0.3.0-alpha.17" [dev-dependencies] pin-utils = "0.1.0-alpha.4" diff --git a/tokio-io/src/async_read.rs b/tokio-io/src/async_read.rs index 4eeaa7bb8..1b7eaa6ce 100644 --- a/tokio-io/src/async_read.rs +++ b/tokio-io/src/async_read.rs @@ -1,6 +1,7 @@ //use crate::split::{ReadHalf, WriteHalf}; //use crate::{framed, split, AsyncWrite}; use bytes::BufMut; +use futures_core::ready; use std::io; use std::ops::DerefMut; use std::pin::Pin; diff --git a/tokio-io/src/async_write.rs b/tokio-io/src/async_write.rs index 80ec74d10..7bcb43399 100644 --- a/tokio-io/src/async_write.rs +++ b/tokio-io/src/async_write.rs @@ -1,5 +1,6 @@ //use crate::AsyncRead; use bytes::Buf; +use futures_core::ready; use std::io; use std::ops::DerefMut; use std::pin::Pin; diff --git a/tokio-io/src/lib.rs b/tokio-io/src/lib.rs index 81a11f8fe..165cc1ca6 100644 --- a/tokio-io/src/lib.rs +++ b/tokio-io/src/lib.rs @@ -12,15 +12,6 @@ //! [found online]: https://tokio.rs/docs/ //! [low level details]: https://tokio.rs/docs/going-deeper-tokio/core-low-level/ -macro_rules! ready { - ($e:expr) => { - match $e { - ::std::task::Poll::Ready(t) => t, - ::std::task::Poll::Pending => return ::std::task::Poll::Pending, - } - }; -} - mod async_read; mod async_write; diff --git a/tokio-reactor/Cargo.toml b/tokio-reactor/Cargo.toml index ed939a9cc..f504ccae8 100644 --- a/tokio-reactor/Cargo.toml +++ b/tokio-reactor/Cargo.toml @@ -33,6 +33,7 @@ slab = "0.4.0" tokio-executor = { version = "0.2.0", path = "../tokio-executor" } tokio-io = { version = "0.2.0", path = "../tokio-io" } tokio-sync = { version = "0.2.0", path = "../tokio-sync" } +futures-core-preview = "0.3.0-alpha.17" [dev-dependencies] num_cpus = "1.8.0" diff --git a/tokio-reactor/src/lib.rs b/tokio-reactor/src/lib.rs index ff2ab6864..5eae81dab 100644 --- a/tokio-reactor/src/lib.rs +++ b/tokio-reactor/src/lib.rs @@ -32,15 +32,6 @@ //! [`PollEvented`]: struct.PollEvented.html //! [reactor module]: https://docs.rs/tokio/0.1/tokio/reactor/index.html -macro_rules! ready { - ($e:expr) => { - match $e { - ::std::task::Poll::Ready(v) => v, - ::std::task::Poll::Pending => return ::std::task::Poll::Pending, - } - }; -} - mod poll_evented; mod registration; mod sharded_rwlock; diff --git a/tokio-reactor/src/poll_evented.rs b/tokio-reactor/src/poll_evented.rs index 5b2802942..50f21434f 100644 --- a/tokio-reactor/src/poll_evented.rs +++ b/tokio-reactor/src/poll_evented.rs @@ -1,4 +1,5 @@ use crate::{Handle, Registration}; +use futures_core::ready; use mio; use mio::event::Evented; use std::fmt; diff --git a/tokio-sync/Cargo.toml b/tokio-sync/Cargo.toml index 66022b30a..e8fddf16f 100644 --- a/tokio-sync/Cargo.toml +++ b/tokio-sync/Cargo.toml @@ -22,13 +22,13 @@ categories = ["asynchronous"] publish = false [features] -async-traits = ["tokio-futures", "futures-core-preview"] +async-traits = ["tokio-futures"] [dependencies] async-util = { git = "https://github.com/tokio-rs/async" } tokio-futures = { path = "../tokio-futures", optional = true } fnv = "1.0.6" -futures-core-preview = { version = "0.3.0-alpha.17", optional = true } +futures-core-preview = { version = "0.3.0-alpha.17" } [dev-dependencies] env_logger = { version = "0.5", default-features = false } diff --git a/tokio-sync/src/lib.rs b/tokio-sync/src/lib.rs index 384740ac6..00f9b7009 100644 --- a/tokio-sync/src/lib.rs +++ b/tokio-sync/src/lib.rs @@ -21,19 +21,6 @@ macro_rules! debug { } } -/// Unwrap a ready value or propagate `Poll::Pending`. -#[macro_export] -macro_rules! ready { - ($e:expr) => {{ - use std::task::Poll::{Pending, Ready}; - - match $e { - Ready(v) => v, - Pending => return Pending, - } - }}; -} - macro_rules! if_fuzz { ($($t:tt)*) => {{ if false { $($t)* } diff --git a/tokio-sync/src/lock.rs b/tokio-sync/src/lock.rs index 10f6a112d..8b2bc0bcf 100644 --- a/tokio-sync/src/lock.rs +++ b/tokio-sync/src/lock.rs @@ -42,6 +42,7 @@ use crate::semaphore; +use futures_core::ready; use std::cell::UnsafeCell; use std::fmt; use std::future::Future; diff --git a/tokio-sync/src/oneshot.rs b/tokio-sync/src/oneshot.rs index 910d24ddc..86f1cd82b 100644 --- a/tokio-sync/src/oneshot.rs +++ b/tokio-sync/src/oneshot.rs @@ -2,6 +2,7 @@ use crate::loom::{sync::atomic::AtomicUsize, sync::CausalCell}; +use futures_core::ready; use std::fmt; use std::future::Future; use std::mem::{self, ManuallyDrop}; diff --git a/tokio-sync/src/watch.rs b/tokio-sync/src/watch.rs index ed35b0aaf..91d5d2b5e 100644 --- a/tokio-sync/src/watch.rs +++ b/tokio-sync/src/watch.rs @@ -58,6 +58,7 @@ use crate::task::AtomicWaker; use core::task::Poll::{Pending, Ready}; use core::task::{Context, Poll}; use fnv::FnvHashMap; +use futures_core::ready; use std::ops; use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering::SeqCst; diff --git a/tokio-sync/tests/fuzz_oneshot.rs b/tokio-sync/tests/fuzz_oneshot.rs index f8987af6c..eb4dfcde4 100644 --- a/tokio-sync/tests/fuzz_oneshot.rs +++ b/tokio-sync/tests/fuzz_oneshot.rs @@ -1,19 +1,6 @@ #![deny(warnings, rust_2018_idioms)] #![feature(async_await)] -/// Unwrap a ready value or propagate `Async::Pending`. -#[macro_export] -macro_rules! ready { - ($e:expr) => {{ - use std::task::Poll::{Pending, Ready}; - - match $e { - Ready(v) => v, - Pending => return Pending, - } - }}; -} - #[path = "../src/oneshot.rs"] #[allow(warnings)] mod oneshot; diff --git a/tokio-sync/tests/fuzz_semaphore.rs b/tokio-sync/tests/fuzz_semaphore.rs index ca2fda8b9..55d6bf0d7 100644 --- a/tokio-sync/tests/fuzz_semaphore.rs +++ b/tokio-sync/tests/fuzz_semaphore.rs @@ -10,6 +10,7 @@ mod semaphore; use crate::semaphore::*; use async_util::future::poll_fn; +use futures_core::ready; use loom::futures::block_on; use loom::thread; use std::future::Future; @@ -20,19 +21,6 @@ use std::sync::Arc; use std::task::Poll::Ready; use std::task::{Context, Poll}; -/// Unwrap a ready value or propagate `Poll::Pending`. -#[macro_export] -macro_rules! ready { - ($e:expr) => {{ - use std::task::Poll::{Pending, Ready}; - - match $e { - Ready(v) => v, - Pending => return Pending, - } - }}; -} - #[test] fn basic_usage() { const NUM: usize = 2; diff --git a/tokio-tcp/Cargo.toml b/tokio-tcp/Cargo.toml index 2bb387d92..776f14b9a 100644 --- a/tokio-tcp/Cargo.toml +++ b/tokio-tcp/Cargo.toml @@ -22,7 +22,7 @@ categories = ["asynchronous"] publish = false [features] -incoming = ["futures-core-preview"] +incoming = [] [dependencies] async-util = { git = "https://github.com/tokio-rs/async" } @@ -33,7 +33,7 @@ mio = "0.6.14" iovec = "0.1" # optionals -futures-core-preview = { version = "0.3.0-alpha.17", optional = true } +futures-core-preview = { version = "0.3.0-alpha.17" } [dev-dependencies] #env_logger = { version = "0.5", default-features = false } diff --git a/tokio-tcp/src/incoming.rs b/tokio-tcp/src/incoming.rs index 566734de5..00c2e01df 100644 --- a/tokio-tcp/src/incoming.rs +++ b/tokio-tcp/src/incoming.rs @@ -1,5 +1,6 @@ use super::TcpListener; use super::TcpStream; +use futures_core::ready; use futures_core::stream::Stream; use std::io; use std::pin::Pin; diff --git a/tokio-tcp/src/lib.rs b/tokio-tcp/src/lib.rs index d50e4b6e4..3a8e04b30 100644 --- a/tokio-tcp/src/lib.rs +++ b/tokio-tcp/src/lib.rs @@ -23,15 +23,6 @@ //! [incoming_method]: struct.TcpListener.html#method.incoming //! [`Incoming`]: struct.Incoming.html -macro_rules! ready { - ($e:expr) => { - match $e { - ::std::task::Poll::Ready(t) => t, - ::std::task::Poll::Pending => return ::std::task::Poll::Pending, - } - }; -} - #[cfg(feature = "incoming")] mod incoming; mod listener; diff --git a/tokio-tcp/src/listener.rs b/tokio-tcp/src/listener.rs index 50621d00b..8fa1b4bce 100644 --- a/tokio-tcp/src/listener.rs +++ b/tokio-tcp/src/listener.rs @@ -1,6 +1,7 @@ #[cfg(feature = "incoming")] use super::incoming::Incoming; use super::TcpStream; +use futures_core::ready; use mio; use std::convert::TryFrom; use std::fmt; diff --git a/tokio-tcp/src/stream.rs b/tokio-tcp/src/stream.rs index f2253a5ef..e621f8708 100644 --- a/tokio-tcp/src/stream.rs +++ b/tokio-tcp/src/stream.rs @@ -1,5 +1,6 @@ use crate::split::{split, TcpStreamReadHalf, TcpStreamWriteHalf}; use bytes::{Buf, BufMut}; +use futures_core::ready; use iovec::IoVec; use mio; use std::convert::TryFrom; diff --git a/tokio-test/Cargo.toml b/tokio-test/Cargo.toml index 95e94896a..92573a839 100644 --- a/tokio-test/Cargo.toml +++ b/tokio-test/Cargo.toml @@ -28,6 +28,7 @@ tokio-executor = { version = "0.2.0", path = "../tokio-executor" } tokio-io = { version = "0.2.0", path = "../tokio-io" } tokio-sync = { version = "0.2.0", path = "../tokio-sync" } tokio-timer = { version = "0.3.0", path = "../tokio-timer" } +futures-core-preview = "0.3.0-alpha.17" [dev-dependencies] tokio = { path = "../tokio" } diff --git a/tokio-test/src/io.rs b/tokio-test/src/io.rs index 568a81fcf..881ffe1a3 100644 --- a/tokio-test/src/io.rs +++ b/tokio-test/src/io.rs @@ -20,6 +20,7 @@ use std::task::{self, Poll, Waker}; use std::time::{Duration, Instant}; use std::{cmp, io}; +use futures_core::ready; use tokio_io::{AsyncRead, AsyncWrite}; use tokio_sync::mpsc; use tokio_timer::{clock, timer, Delay}; diff --git a/tokio-test/src/lib.rs b/tokio-test/src/lib.rs index 00d38897a..7cfd428c7 100644 --- a/tokio-test/src/lib.rs +++ b/tokio-test/src/lib.rs @@ -20,15 +20,6 @@ //! assert_ready!(fut.poll()); //! ``` -macro_rules! ready { - ($e:expr) => { - match $e { - ::std::task::Poll::Ready(t) => t, - ::std::task::Poll::Pending => return ::std::task::Poll::Pending, - } - }; -} - pub mod clock; pub mod io; mod macros; diff --git a/tokio-threadpool/Cargo.toml b/tokio-threadpool/Cargo.toml index cb3b454ab..e4f90c7a5 100644 --- a/tokio-threadpool/Cargo.toml +++ b/tokio-threadpool/Cargo.toml @@ -25,6 +25,7 @@ publish = false [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" arc-waker = { git = "https://github.com/tokio-rs/async" } crossbeam-deque = "0.7.0" diff --git a/tokio-threadpool/src/blocking.rs b/tokio-threadpool/src/blocking.rs index c50a28ace..720288367 100644 --- a/tokio-threadpool/src/blocking.rs +++ b/tokio-threadpool/src/blocking.rs @@ -1,5 +1,6 @@ use crate::worker::Worker; +use futures_core::ready; use std::error::Error; use std::fmt; use std::task::Poll; diff --git a/tokio-threadpool/src/lib.rs b/tokio-threadpool/src/lib.rs index dcf95933e..888dbe8c4 100644 --- a/tokio-threadpool/src/lib.rs +++ b/tokio-threadpool/src/lib.rs @@ -131,15 +131,6 @@ pub mod park; -macro_rules! ready { - ($e:expr) => { - match $e { - ::std::task::Poll::Ready(t) => t, - ::std::task::Poll::Pending => return ::std::task::Poll::Pending, - } - }; -} - mod blocking; mod builder; mod callback; diff --git a/tokio-threadpool/tests/blocking.rs b/tokio-threadpool/tests/blocking.rs index e5ef81a64..012594816 100644 --- a/tokio-threadpool/tests/blocking.rs +++ b/tokio-threadpool/tests/blocking.rs @@ -5,6 +5,7 @@ use tokio_test::*; use tokio_threadpool::*; use async_util::future::poll_fn; +use futures_core::ready; use rand::*; use std::sync::atomic::Ordering::*; use std::sync::atomic::*; @@ -13,15 +14,6 @@ use std::task::{Poll, Waker}; use std::thread; use std::time::Duration; -macro_rules! ready { - ($e:expr) => { - match $e { - ::std::task::Poll::Ready(t) => t, - ::std::task::Poll::Pending => return ::std::task::Poll::Pending, - } - }; -} - #[test] fn basic() { let _ = ::env_logger::try_init(); diff --git a/tokio-timer/Cargo.toml b/tokio-timer/Cargo.toml index e6e5853a2..5cdbaa49f 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 7411e0717..41210690e 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 79b1d29fc..d9d0f36cb 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 e112d07ae..f04486403 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 48b9ba00a..36449472c 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 494c42cc9..dae09320f 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 a8ce0d52d..18068778b 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; diff --git a/tokio-udp/Cargo.toml b/tokio-udp/Cargo.toml index d3dc66d8a..2af96b5d2 100644 --- a/tokio-udp/Cargo.toml +++ b/tokio-udp/Cargo.toml @@ -28,6 +28,7 @@ tokio-reactor = { version = "0.2.0", path = "../tokio-reactor" } # bytes = "0.4" mio = "0.6.14" log = "0.4" +futures-core-preview = "0.3.0-alpha.17" [dev-dependencies] env_logger = { version = "0.5", default-features = false } diff --git a/tokio-udp/src/lib.rs b/tokio-udp/src/lib.rs index 2fe90a8fa..13ffeeec9 100644 --- a/tokio-udp/src/lib.rs +++ b/tokio-udp/src/lib.rs @@ -12,15 +12,6 @@ //! Reading and writing to it can be done using futures, which return the //! [`Recv`], [`Send`], [`RecvFrom`] and [`SendTo`] structs respectively. -macro_rules! ready { - ($e:expr) => { - match $e { - ::std::task::Poll::Ready(t) => t, - ::std::task::Poll::Pending => return ::std::task::Poll::Pending, - } - }; -} - // mod frame; mod recv; mod recv_from; diff --git a/tokio-udp/src/socket.rs b/tokio-udp/src/socket.rs index 55648a429..6cbec5f8c 100644 --- a/tokio-udp/src/socket.rs +++ b/tokio-udp/src/socket.rs @@ -1,5 +1,6 @@ use super::split::{split, UdpSocketRecvHalf, UdpSocketSendHalf}; use super::{Recv, RecvFrom, Send, SendTo}; +use futures_core::ready; use mio; use std::convert::TryFrom; use std::fmt; diff --git a/tokio-uds/Cargo.toml b/tokio-uds/Cargo.toml index 2d941ec40..8a4437dcf 100644 --- a/tokio-uds/Cargo.toml +++ b/tokio-uds/Cargo.toml @@ -22,11 +22,11 @@ categories = ["asynchronous"] publish = false [features] -async-traits = ["futures-core-preview"] +async-traits = [] [dependencies] bytes = "0.4.8" -futures-core-preview = { version = "0.3.0-alpha.17", optional = true } +futures-core-preview = { version = "0.3.0-alpha.17" } iovec = "0.1.2" libc = "0.2.42" log = "0.4.2" diff --git a/tokio-uds/src/datagram.rs b/tokio-uds/src/datagram.rs index 87d1d49b9..6213a625a 100644 --- a/tokio-uds/src/datagram.rs +++ b/tokio-uds/src/datagram.rs @@ -1,4 +1,5 @@ use crate::{Recv, RecvFrom, Send, SendTo}; +use futures_core::ready; use mio::Ready; use mio_uds; use std::fmt; diff --git a/tokio-uds/src/incoming.rs b/tokio-uds/src/incoming.rs index 1a16302af..0bdbcad56 100644 --- a/tokio-uds/src/incoming.rs +++ b/tokio-uds/src/incoming.rs @@ -1,6 +1,7 @@ #![cfg(feature = "async-traits")] use crate::{UnixListener, UnixStream}; +use futures_core::ready; use futures_core::stream::Stream; use std::io; use std::pin::Pin; diff --git a/tokio-uds/src/lib.rs b/tokio-uds/src/lib.rs index fef2a5c56..9ea1135b4 100644 --- a/tokio-uds/src/lib.rs +++ b/tokio-uds/src/lib.rs @@ -8,15 +8,6 @@ //! //! This crate provides APIs for using Unix Domain Sockets with Tokio. -macro_rules! ready { - ($e:expr) => { - match $e { - ::std::task::Poll::Ready(t) => t, - ::std::task::Poll::Pending => return ::std::task::Poll::Pending, - } - }; -} - mod datagram; // mod frame; mod incoming; diff --git a/tokio-uds/src/listener.rs b/tokio-uds/src/listener.rs index e875344a1..17c503055 100644 --- a/tokio-uds/src/listener.rs +++ b/tokio-uds/src/listener.rs @@ -1,4 +1,5 @@ use crate::UnixStream; +use futures_core::ready; use mio::Ready; use mio_uds; use std::convert::TryFrom; diff --git a/tokio-uds/src/stream.rs b/tokio-uds/src/stream.rs index dfaa4fd98..7d13245f1 100644 --- a/tokio-uds/src/stream.rs +++ b/tokio-uds/src/stream.rs @@ -1,5 +1,6 @@ use crate::ucred::{self, UCred}; use bytes::{Buf, BufMut}; +use futures_core::ready; use iovec::IoVec; use mio::Ready; use mio_uds; diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 52bee83cf..3eaeff971 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -62,6 +62,7 @@ uds = ["tokio-uds"] [dependencies] # Only non-optional dependency... #futures = "0.1.20" +futures-core-preview = "0.3.0-alpha.17" # Everything else is optional... bytes = { version = "0.4", optional = true } diff --git a/tokio/src/io/copy.rs b/tokio/src/io/copy.rs index cc8e71dd6..a324cbf8c 100644 --- a/tokio/src/io/copy.rs +++ b/tokio/src/io/copy.rs @@ -1,3 +1,4 @@ +use futures_core::ready; use std::future::Future; use std::io; use std::pin::Pin; diff --git a/tokio/src/io/read_exact.rs b/tokio/src/io/read_exact.rs index 323208144..82b953629 100644 --- a/tokio/src/io/read_exact.rs +++ b/tokio/src/io/read_exact.rs @@ -1,3 +1,4 @@ +use futures_core::ready; use std::future::Future; use std::io; use std::marker::Unpin; diff --git a/tokio/src/io/read_to_end.rs b/tokio/src/io/read_to_end.rs index 2433e6ee5..558be6b8d 100644 --- a/tokio/src/io/read_to_end.rs +++ b/tokio/src/io/read_to_end.rs @@ -1,5 +1,6 @@ use tokio_io::AsyncRead; +use futures_core::ready; use std::future::Future; use std::io; use std::pin::Pin; diff --git a/tokio/src/io/write_all.rs b/tokio/src/io/write_all.rs index c337ee78c..411dce4cc 100644 --- a/tokio/src/io/write_all.rs +++ b/tokio/src/io/write_all.rs @@ -1,5 +1,6 @@ use tokio_io::AsyncWrite; +use futures_core::ready; use std::future::Future; use std::io; use std::mem; diff --git a/tokio/src/lib.rs b/tokio/src/lib.rs index 1e30d756f..6a28699cc 100644 --- a/tokio/src/lib.rs +++ b/tokio/src/lib.rs @@ -75,15 +75,6 @@ macro_rules! if_runtime { )*) } -macro_rules! ready { - ($e:expr) => { - match $e { - ::std::task::Poll::Ready(t) => t, - ::std::task::Poll::Pending => return ::std::task::Poll::Pending, - } - }; -} - #[cfg(feature = "timer")] pub mod clock; #[cfg(feature = "codec")]