Skip to content

Commit cd86208

Browse files
committed
Add Flatten struct
1 parent 2187a2a commit cd86208

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/stream/stream/flatten.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,21 @@ where
3939
}
4040
}
4141

42+
pub struct Flatten<S: Stream>
43+
where
44+
S::Item: IntoStream,
45+
{
46+
inner: FlattenCompat<S, <S::Item as IntoStream>::IntoStream>,
47+
}
48+
49+
impl<S: Stream<Item: IntoStream>> Flatten<S> {
50+
pin_utils::unsafe_pinned!(inner: FlattenCompat<S, <S::Item as IntoStream>::IntoStream>);
51+
52+
pub fn new(stream: S) -> Flatten<S> {
53+
Flatten { inner: FlattenCompat::new(stream) }
54+
}
55+
}
56+
4257
/// Real logic of both `Flatten` and `FlatMap` which simply delegate to
4358
/// this type.
4459
#[derive(Clone, Debug)]

0 commit comments

Comments
 (0)