diff --git a/src/vec/from_stream.rs b/src/vec/from_stream.rs index ad82797..8848bda 100644 --- a/src/vec/from_stream.rs +++ b/src/vec/from_stream.rs @@ -1,7 +1,6 @@ use std::pin::Pin; -use crate::prelude::*; -use crate::stream::{FromStream, IntoStream}; +use crate::stream::{FromStream, IntoStream, Extend}; impl FromStream for Vec { #[inline] @@ -17,9 +16,7 @@ impl FromStream for Vec { pin_utils::pin_mut!(stream); let mut out = vec![]; - while let Some(item) = stream.next().await { - out.push(item); - } + out.stream_extend(stream).await; out })) }