Skip to content

Commit 7522390

Browse files
committed
fix: Stabilize stream most method
1 parent be60dd9 commit 7522390

File tree

15 files changed

+43
-89
lines changed

15 files changed

+43
-89
lines changed

src/stream/double_ended_stream/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ use try_rfold::TryRFoldFuture;
2222
/// `Item`s from the back, as well as the front.
2323
///
2424
/// [`Stream`]: trait.Stream.html
25-
#[cfg(feature = "unstable")]
26-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
2725
pub trait DoubleEndedStream: Stream {
2826
#[doc = r#"
2927
Attempts to receive the next item from the back of the stream.

src/stream/exact_size_stream.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ pub use crate::stream::Stream;
7676
/// # });
7777
/// ```
7878
#[allow(clippy::len_without_is_empty)] // ExactSizeIterator::is_empty is unstable
79-
#[cfg(feature = "unstable")]
80-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
8179
pub trait ExactSizeStream: Stream {
8280
/// Returns the exact number of times the stream will iterate.
8381
///

src/stream/extend.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ use crate::stream::IntoStream;
2727
/// #
2828
/// # })
2929
/// ```
30-
#[cfg(feature = "unstable")]
31-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
3230
pub trait Extend<A> {
3331
/// Extends a collection with the contents of a stream.
3432
fn extend<'a, T: IntoStream<Item = A> + 'a>(

src/stream/fused_stream.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ use crate::stream::Stream;
1414
/// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None
1515
/// [`Stream::fuse`]: trait.Stream.html#method.fuse
1616
/// [`Fuse`]: struct.Fuse.html
17-
#[cfg(feature = "unstable")]
18-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
1917
pub trait FusedStream: Stream {}
2018

2119
impl<S: FusedStream + ?Sized + Unpin> FusedStream for &mut S {}

src/stream/interval.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ use futures_timer::Delay;
4141
/// #
4242
/// # Ok(()) }) }
4343
/// ```
44-
#[cfg(feature = "unstable")]
45-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
4644
pub fn interval(dur: Duration) -> Interval {
4745
Interval {
4846
delay: Delay::new(dur),
@@ -56,8 +54,6 @@ pub fn interval(dur: Duration) -> Interval {
5654
/// documentation for more.
5755
///
5856
/// [`interval`]: fn.interval.html
59-
#[cfg(feature = "unstable")]
60-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
6157
#[derive(Debug)]
6258
pub struct Interval {
6359
delay: Delay,

src/stream/mod.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -300,46 +300,46 @@
300300
//! [`take`]: trait.Stream.html#method.take
301301
//! [`min`]: trait.Stream.html#method.min
302302
303+
pub use double_ended_stream::DoubleEndedStream;
303304
pub use empty::{empty, Empty};
305+
pub use exact_size_stream::ExactSizeStream;
304306
pub use from_fn::{from_fn, FromFn};
305307
pub use from_iter::{from_iter, FromIter};
308+
pub use fused_stream::FusedStream;
309+
pub use interval::{interval, Interval};
306310
pub use once::{once, Once};
311+
pub use pending::{pending, Pending};
312+
pub use product::Product;
307313
pub use repeat::{repeat, Repeat};
308314
pub use repeat_with::{repeat_with, RepeatWith};
315+
pub use stream::Merge;
309316
pub use stream::*;
317+
pub use successors::{successors, Successors};
318+
pub use sum::Sum;
310319

311320
pub(crate) mod stream;
312321

322+
mod double_ended_stream;
313323
mod empty;
324+
mod exact_size_stream;
314325
mod from_fn;
315326
mod from_iter;
327+
mod fused_stream;
328+
mod interval;
316329
mod once;
330+
mod pending;
331+
mod product;
317332
mod repeat;
318333
mod repeat_with;
334+
mod successors;
335+
mod sum;
319336

320337
cfg_unstable! {
321-
mod double_ended_stream;
322-
mod exact_size_stream;
323-
mod extend;
324338
mod from_stream;
325-
mod fused_stream;
326-
mod interval;
327339
mod into_stream;
328-
mod pending;
329-
mod product;
330-
mod successors;
331-
mod sum;
340+
mod extend;
332341

333-
pub use double_ended_stream::DoubleEndedStream;
334-
pub use exact_size_stream::ExactSizeStream;
335342
pub use extend::{extend, Extend};
336343
pub use from_stream::FromStream;
337-
pub use fused_stream::FusedStream;
338-
pub use interval::{interval, Interval};
339344
pub use into_stream::IntoStream;
340-
pub use pending::{pending, Pending};
341-
pub use product::Product;
342-
pub use stream::Merge;
343-
pub use successors::{successors, Successors};
344-
pub use sum::Sum;
345345
}

src/stream/once.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use pin_project_lite::pin_project;
55
use crate::stream::Stream;
66
use crate::task::{Context, Poll};
77

8-
#[cfg(feature = "unstable")]
98
use crate::stream::DoubleEndedStream;
109

1110
/// Creates a stream that yields a single item.
@@ -50,8 +49,7 @@ impl<T> Stream for Once<T> {
5049
}
5150
}
5251

53-
#[cfg(feature = "unstable")]
54-
impl <T> DoubleEndedStream for Once<T> {
52+
impl<T> DoubleEndedStream for Once<T> {
5553
fn poll_next_back(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
5654
Poll::Ready(self.project().value.take())
5755
}

src/stream/product.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use core::pin::Pin;
21
use core::future::Future;
2+
use core::pin::Pin;
33

44
use crate::stream::Stream;
55

@@ -13,8 +13,6 @@ use crate::stream::Stream;
1313
/// [`product`]: trait.Product.html#tymethod.product
1414
/// [`FromStream`]: trait.FromStream.html
1515
/// [`Stream::product`]: trait.Stream.html#method.product
16-
#[cfg(feature = "unstable")]
17-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
1816
pub trait Product<A = Self>: Sized {
1917
/// Method which takes a stream and generates `Self` from the elements by
2018
/// multiplying the items.
@@ -23,9 +21,9 @@ pub trait Product<A = Self>: Sized {
2321
S: Stream<Item = A> + 'a;
2422
}
2523

26-
use core::ops::Mul;
27-
use core::num::Wrapping;
2824
use crate::stream::stream::StreamExt;
25+
use core::num::Wrapping;
26+
use core::ops::Mul;
2927

3028
macro_rules! integer_product {
3129
(@impls $one: expr, $($a:ty)*) => ($(
@@ -75,5 +73,5 @@ macro_rules! float_product {
7573
);
7674
}
7775

78-
integer_product!{ i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }
79-
float_product!{ f32 f64 }
76+
integer_product! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }
77+
float_product! { f32 f64 }

src/stream/stream/count.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ use crate::task::{Context, Poll};
99
pin_project! {
1010
#[doc(hidden)]
1111
#[allow(missing_debug_implementations)]
12-
#[cfg(feature = "unstable")]
13-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
1412
pub struct CountFuture<S> {
1513
#[pin]
1614
stream: S,

src/stream/stream/merge.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ pin_project! {
1616
///
1717
/// [`merge`]: trait.Stream.html#method.merge
1818
/// [`Stream`]: trait.Stream.html
19-
#[cfg(feature = "unstable")]
20-
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
2119
#[derive(Debug)]
2220
pub struct Merge<L, R> {
2321
#[pin]

0 commit comments

Comments
 (0)