Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions futures-util/src/async_await/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;

Expand Down
2 changes: 0 additions & 2 deletions futures-util/src/async_await/select_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,15 +307,13 @@ macro_rules! document_select_macro {
};
}

#[cfg(feature = "std")]
#[doc(hidden)]
pub use futures_macro::select_internal;

#[doc(hidden)]
pub use futures_macro::select_biased_internal;

document_select_macro! {
#[cfg(feature = "std")]
#[macro_export]
macro_rules! select {
($($tokens:tt)*) => {{
Expand Down
2 changes: 1 addition & 1 deletion futures-util/src/future/always_ready.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<T, F: Fn() -> T> Future for AlwaysReady<T, F> {

/// 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<dyn Future<Output = T>>`],
/// This is particularly useful in avoiding a heap allocation when an API needs `Box<dyn Future<Output = T>>`,
/// as [`AlwaysReady`] does not have to store a boolean for `is_finished`.
///
/// # Examples
Expand Down
4 changes: 2 additions & 2 deletions futures-util/src/stream/repeat_with.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ impl<A, F: FnMut() -> A> FusedStream for RepeatWith<F> {
/// 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
///
Expand Down
10 changes: 6 additions & 4 deletions futures-util/src/stream/select_with_strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ pin_project! {
/// ## Examples
///
/// ### Priority
///
/// This example shows how to always prioritize the left stream.
///
/// ```rust
Expand All @@ -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 {
Expand All @@ -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.
Expand Down
10 changes: 2 additions & 8 deletions futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading