|
|
@ -9,11 +9,9 @@ impl<T> Extend<T> for Vec<T> {
|
|
|
|
stream: S,
|
|
|
|
stream: S,
|
|
|
|
) -> Pin<Box<dyn Future<Output = ()> + 'a>> {
|
|
|
|
) -> Pin<Box<dyn Future<Output = ()> + 'a>> {
|
|
|
|
let stream = stream.into_stream();
|
|
|
|
let stream = stream.into_stream();
|
|
|
|
Box::pin(async move {
|
|
|
|
//TODO: Add this back in when size_hint is added to Stream/StreamExt
|
|
|
|
pin_utils::pin_mut!(stream);
|
|
|
|
//let (lower_bound, _) = stream.size_hint();
|
|
|
|
while let Some(item) = stream.next().await {
|
|
|
|
//self.reserve(lower_bound);
|
|
|
|
self.push(item);
|
|
|
|
Box::pin(stream.for_each(move |item| self.push(item)))
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|