|
|
@ -1,5 +1,5 @@
|
|
|
|
use std::pin::Pin;
|
|
|
|
|
|
|
|
use pin_project_lite::pin_project;
|
|
|
|
use pin_project_lite::pin_project;
|
|
|
|
|
|
|
|
use std::pin::Pin;
|
|
|
|
|
|
|
|
|
|
|
|
use crate::prelude::*;
|
|
|
|
use crate::prelude::*;
|
|
|
|
use crate::stream::stream::map::Map;
|
|
|
|
use crate::stream::stream::map::Map;
|
|
|
@ -25,7 +25,6 @@ where
|
|
|
|
U: IntoStream,
|
|
|
|
U: IntoStream,
|
|
|
|
F: FnMut(S::Item) -> U,
|
|
|
|
F: FnMut(S::Item) -> U,
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
pub fn new(stream: S, f: F) -> FlatMap<S, U, S::Item, F> {
|
|
|
|
pub fn new(stream: S, f: F) -> FlatMap<S, U, S::Item, F> {
|
|
|
|
FlatMap {
|
|
|
|
FlatMap {
|
|
|
|
inner: FlattenCompat::new(stream.map(f)),
|
|
|
|
inner: FlattenCompat::new(stream.map(f)),
|
|
|
@ -46,7 +45,7 @@ where
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pin_project!{
|
|
|
|
pin_project! {
|
|
|
|
/// This `struct` is created by the [`flatten`] method on [`Stream`]. See its
|
|
|
|
/// This `struct` is created by the [`flatten`] method on [`Stream`]. See its
|
|
|
|
/// documentation for more.
|
|
|
|
/// documentation for more.
|
|
|
|
///
|
|
|
|
///
|
|
|
@ -61,7 +60,9 @@ pin_project!{
|
|
|
|
|
|
|
|
|
|
|
|
impl<S: Stream<Item: IntoStream>> Flatten<S, S::Item> {
|
|
|
|
impl<S: Stream<Item: IntoStream>> Flatten<S, S::Item> {
|
|
|
|
pub fn new(stream: S) -> Flatten<S, S::Item> {
|
|
|
|
pub fn new(stream: S) -> Flatten<S, S::Item> {
|
|
|
|
Flatten { inner: FlattenCompat::new(stream) }
|
|
|
|
Flatten {
|
|
|
|
|
|
|
|
inner: FlattenCompat::new(stream),
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -77,7 +78,6 @@ where
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pin_project! {
|
|
|
|
pin_project! {
|
|
|
|
/// Real logic of both `Flatten` and `FlatMap` which simply delegate to
|
|
|
|
/// Real logic of both `Flatten` and `FlatMap` which simply delegate to
|
|
|
|
/// this type.
|
|
|
|
/// this type.
|
|
|
|