We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24ff25c commit 74a6bd9Copy full SHA for 74a6bd9
src/vec/extend.rs
@@ -9,11 +9,9 @@ impl<T> Extend<T> for Vec<T> {
9
stream: S,
10
) -> Pin<Box<dyn Future<Output = ()> + 'a>> {
11
let stream = stream.into_stream();
12
- Box::pin(async move {
13
- pin_utils::pin_mut!(stream);
14
- while let Some(item) = stream.next().await {
15
- self.push(item);
16
- }
17
- })
+ //TODO: Add this back in when size_hint is added to Stream/StreamExt
+ //let (lower_bound, _) = stream.size_hint();
+ //self.reserve(lower_bound);
+ Box::pin(stream.for_each(move |item| self.push(item)))
18
}
19
0 commit comments