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 76b10c4 commit ab7129cCopy full SHA for ab7129c
src/vec/from_stream.rs
@@ -1,7 +1,6 @@
1
use std::pin::Pin;
2
3
-use crate::prelude::*;
4
-use crate::stream::{FromStream, IntoStream};
+use crate::stream::{FromStream, IntoStream, Extend};
5
6
impl<T> FromStream<T> for Vec<T> {
7
#[inline]
@@ -17,9 +16,7 @@ impl<T> FromStream<T> for Vec<T> {
17
16
pin_utils::pin_mut!(stream);
18
19
let mut out = vec![];
20
- while let Some(item) = stream.next().await {
21
- out.push(item);
22
- }
+ out.stream_extend(stream).await;
23
out
24
}))
25
}
0 commit comments