From 00d936488b8909fdfc8896f485d7520ef0f3b0a4 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Tue, 15 Oct 2019 16:33:23 +0200 Subject: [PATCH] stabilize future::timeout (#335) Signed-off-by: Yoshua Wuyts --- src/future/mod.rs | 4 ++-- src/future/timeout.rs | 6 ------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/future/mod.rs b/src/future/mod.rs index 06d0633..cc3b7a5 100644 --- a/src/future/mod.rs +++ b/src/future/mod.rs @@ -54,18 +54,18 @@ pub use future::Future; pub use pending::pending; pub use poll_fn::poll_fn; pub use ready::ready; +pub use timeout::{timeout, TimeoutError}; pub(crate) mod future; mod pending; mod poll_fn; mod ready; +mod timeout; cfg_if! { if #[cfg(any(feature = "unstable", feature = "docs"))] { mod into_future; - mod timeout; pub use into_future::IntoFuture; - pub use timeout::{timeout, TimeoutError}; } } diff --git a/src/future/timeout.rs b/src/future/timeout.rs index aa88f64..a8338fb 100644 --- a/src/future/timeout.rs +++ b/src/future/timeout.rs @@ -28,8 +28,6 @@ use crate::task::{Context, Poll}; /// # /// # Ok(()) }) } /// ``` -#[cfg_attr(feature = "docs", doc(cfg(unstable)))] -#[cfg(any(feature = "unstable", feature = "docs"))] pub async fn timeout(dur: Duration, f: F) -> Result where F: Future, @@ -42,8 +40,6 @@ where } /// A future that times out after a duration of time. -#[doc(hidden)] -#[allow(missing_debug_implementations)] struct TimeoutFuture { future: F, delay: Delay, @@ -69,8 +65,6 @@ impl Future for TimeoutFuture { } /// An error returned when a future times out. -#[cfg_attr(feature = "docs", doc(cfg(unstable)))] -#[cfg(any(feature = "unstable", feature = "docs"))] #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct TimeoutError { _private: (),