Skip to content

Commit f6f8c77

Browse files
Greg Bonikcramertj
Greg Bonik
authored andcommitted
Enable try_buffer_unordered only if std is available
1 parent cdf4014 commit f6f8c77

File tree

1 file changed

+7
-3
lines changed
  • futures-util/src/try_stream

1 file changed

+7
-3
lines changed

futures-util/src/try_stream/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ pub use self::try_for_each::TryForEach;
2828
mod try_filter_map;
2929
pub use self::try_filter_map::TryFilterMap;
3030

31-
mod try_buffer_unordered;
32-
pub use self::try_buffer_unordered::TryBufferUnordered;
33-
3431
if_std! {
32+
mod try_buffer_unordered;
33+
pub use self::try_buffer_unordered::TryBufferUnordered;
34+
3535
mod try_collect;
3636
pub use self::try_collect::TryCollect;
3737
}
@@ -309,6 +309,9 @@ pub trait TryStreamExt: TryStream {
309309
/// an error or a future's output. An error can be produced either by the
310310
/// underlying stream itself or by one of the futures it yielded.
311311
///
312+
/// This method is only available when the `std` feature of this
313+
/// library is activated, and it is activated by default.
314+
///
312315
/// # Examples
313316
///
314317
/// Results are returned in the order of completion:
@@ -353,6 +356,7 @@ pub trait TryStreamExt: TryStream {
353356
/// assert_eq!(await!(buffered.next()), Some(Err("error in the stream")));
354357
/// # })
355358
/// ```
359+
#[cfg(feature = "std")]
356360
fn try_buffer_unordered(self, n: usize) -> TryBufferUnordered<Self>
357361
where Self::Ok: TryFuture<Error = Self::Error>,
358362
Self: Sized

0 commit comments

Comments
 (0)