Skip to content

Commit 410d16e

Browse files
committed
Add docs + To unstable feature
1 parent 1c1e223 commit 410d16e

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

src/stream/stream/flatten.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ use crate::stream::stream::map::Map;
55
use crate::stream::{IntoStream, Stream};
66
use crate::task::{Context, Poll};
77

8+
/// This `struct` is created by the [`flat_map`] method on [`Stream`]. See its
9+
/// documentation for more.
10+
///
11+
/// [`flat_map`]: trait.Stream.html#method.flat_map
12+
/// [`Stream`]: trait.Stream.html
813
#[allow(missing_debug_implementations)]
914
pub struct FlatMap<S: Stream, U: IntoStream, F> {
1015
inner: FlattenCompat<Map<S, F, S::Item, U>, U>,
@@ -39,6 +44,12 @@ where
3944
}
4045
}
4146

47+
/// This `struct` is created by the [`flatten`] method on [`Stream`]. See its
48+
/// documentation for more.
49+
///
50+
/// [`flatten`]: trait.Stream.html#method.flatten
51+
/// [`Stream`]: trait.Stream.html
52+
#[allow(missing_debug_implementations)]
4253
pub struct Flatten<S: Stream>
4354
where
4455
S::Item: IntoStream,

src/stream/stream/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ mod filter;
3030
mod filter_map;
3131
mod find;
3232
mod find_map;
33-
mod flatten;
3433
mod fold;
3534
mod for_each;
3635
mod fuse;
@@ -78,7 +77,6 @@ use try_for_each::TryForEeachFuture;
7877

7978
pub use chain::Chain;
8079
pub use filter::Filter;
81-
pub use flatten::{FlatMap, Flatten};
8280
pub use fuse::Fuse;
8381
pub use inspect::Inspect;
8482
pub use map::Map;
@@ -93,17 +91,18 @@ pub use zip::Zip;
9391
use std::cmp::Ordering;
9492
use std::marker::PhantomData;
9593

96-
use crate::stream::IntoStream;
97-
9894
cfg_unstable! {
9995
use std::pin::Pin;
10096

10197
use crate::future::Future;
10298
use crate::stream::FromStream;
99+
use crate::stream::into_stream::IntoStream;
103100

104101
pub use merge::Merge;
102+
pub use flatten::{FlatMap, Flatten};
105103

106104
mod merge;
105+
mod flatten;
107106
}
108107

109108
extension_trait! {
@@ -589,6 +588,8 @@ extension_trait! {
589588
# });
590589
```
591590
"#]
591+
#[cfg(feature = "unstable")]
592+
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
592593
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
593594
where
594595
Self: Sized,
@@ -621,6 +622,8 @@ extension_trait! {
621622
622623
# });
623624
"#]
625+
#[cfg(feature = "unstable")]
626+
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
624627
fn flatten(self) -> Flatten<Self>
625628
where
626629
Self: Sized,

0 commit comments

Comments
 (0)