diff --git a/futures-util/src/async_await/mod.rs b/futures-util/src/async_await/mod.rs index 09152f94c..e3e6f4ee1 100644 --- a/futures-util/src/async_await/mod.rs +++ b/futures-util/src/async_await/mod.rs @@ -27,10 +27,8 @@ mod select_mod; pub use self::select_mod::*; // Primary export is a macro -#[cfg(feature = "std")] #[cfg(feature = "async-await-macro")] mod stream_select_mod; -#[cfg(feature = "std")] #[cfg(feature = "async-await-macro")] pub use self::stream_select_mod::*; diff --git a/futures-util/src/async_await/select_mod.rs b/futures-util/src/async_await/select_mod.rs index 882f12515..130eefdb5 100644 --- a/futures-util/src/async_await/select_mod.rs +++ b/futures-util/src/async_await/select_mod.rs @@ -307,7 +307,6 @@ macro_rules! document_select_macro { }; } -#[cfg(feature = "std")] #[doc(hidden)] pub use futures_macro::select_internal; @@ -315,7 +314,6 @@ pub use futures_macro::select_internal; pub use futures_macro::select_biased_internal; document_select_macro! { - #[cfg(feature = "std")] #[macro_export] macro_rules! select { ($($tokens:tt)*) => {{ diff --git a/futures-util/src/future/always_ready.rs b/futures-util/src/future/always_ready.rs index 28625e727..422268857 100644 --- a/futures-util/src/future/always_ready.rs +++ b/futures-util/src/future/always_ready.rs @@ -40,7 +40,7 @@ impl T> Future for AlwaysReady { /// Creates a future that is always immediately ready with a value. /// -/// This is particularly useful in avoiding a heap allocation when an API needs [`Box>`], +/// This is particularly useful in avoiding a heap allocation when an API needs `Box>`, /// as [`AlwaysReady`] does not have to store a boolean for `is_finished`. /// /// # Examples diff --git a/futures-util/src/stream/repeat_with.rs b/futures-util/src/stream/repeat_with.rs index a48251070..b9eb1e0c7 100644 --- a/futures-util/src/stream/repeat_with.rs +++ b/futures-util/src/stream/repeat_with.rs @@ -40,11 +40,11 @@ impl A> FusedStream for RepeatWith { /// The `repeat_with()` function calls the repeater over and over again. /// /// Infinite stream like `repeat_with()` are often used with adapters like -/// [`stream.take()`], in order to make them finite. +/// [`stream.take()`](crate::StreamExt::take), in order to make them finite. /// /// If the element type of the stream you need implements [`Clone`], and /// it is OK to keep the source element in memory, you should instead use -/// the [`stream.repeat()`] function. +/// the [`stream::repeat()`](crate::stream::repeat) function. /// /// # Examples /// diff --git a/futures-util/src/stream/select_with_strategy.rs b/futures-util/src/stream/select_with_strategy.rs index 4375f3e25..f97e34fa1 100644 --- a/futures-util/src/stream/select_with_strategy.rs +++ b/futures-util/src/stream/select_with_strategy.rs @@ -91,6 +91,7 @@ pin_project! { /// ## Examples /// /// ### Priority +/// /// This example shows how to always prioritize the left stream. /// /// ```rust @@ -116,8 +117,9 @@ pin_project! { /// ``` /// /// ### Round Robin -/// This example shows how to select from both streams round robin. -/// Note: this special case is provided by [`futures-util::stream::select`]. +/// +/// This example shows how to select from both streams round-robin. +/// Note: this special case is provided by [`stream::select`](crate::stream::select). /// /// ```rust /// # futures::executor::block_on(async { @@ -126,9 +128,9 @@ pin_project! { /// let left = repeat(1); /// let right = repeat(2); /// -/// let rrobin = |last: &mut PollNext| last.toggle(); +/// let round_robin = |last: &mut PollNext| last.toggle(); /// -/// let mut out = select_with_strategy(left, right, rrobin); +/// let mut out = select_with_strategy(left, right, round_robin); /// /// for _ in 0..100 { /// // We should be alternating now. diff --git a/futures/src/lib.rs b/futures/src/lib.rs index 2c31e76d2..a3437958e 100644 --- a/futures/src/lib.rs +++ b/futures/src/lib.rs @@ -119,20 +119,14 @@ pub use futures_util::{AsyncBufReadExt, AsyncReadExt, AsyncSeekExt, AsyncWriteEx // Macro reexports pub use futures_core::ready; // Readiness propagation -#[cfg(feature = "std")] -#[cfg(feature = "async-await")] -pub use futures_util::select; + #[cfg(feature = "async-await")] -pub use futures_util::{join, pending, poll, select_biased, try_join}; // Async-await +pub use futures_util::{join, pending, poll, select, select_biased, stream_select, try_join}; // Module reexports #[doc(inline)] pub use futures_util::{future, sink, stream, task}; -#[cfg(feature = "std")] -#[cfg(feature = "async-await")] -pub use futures_util::stream_select; - #[cfg(feature = "alloc")] #[doc(inline)] pub use futures_channel as channel;