diff --git a/src/option/from_stream.rs b/src/option/from_stream.rs index 2d36ca1a..2c4c1391 100644 --- a/src/option/from_stream.rs +++ b/src/option/from_stream.rs @@ -19,7 +19,7 @@ where { let stream = stream.into_stream(); - Pin::from(Box::new(async move { + Box::pin(async move { pin_utils::pin_mut!(stream); // Using `scan` here because it is able to stop the stream early @@ -44,6 +44,6 @@ where } else { Some(out) } - })) + }) } } diff --git a/src/result/from_stream.rs b/src/result/from_stream.rs index 74cc5679..6033eb97 100644 --- a/src/result/from_stream.rs +++ b/src/result/from_stream.rs @@ -19,7 +19,7 @@ where { let stream = stream.into_stream(); - Pin::from(Box::new(async move { + Box::pin(async move { pin_utils::pin_mut!(stream); // Using `scan` here because it is able to stop the stream early @@ -43,6 +43,6 @@ where Some(err) => Err(err), None => Ok(out), } - })) + }) } } diff --git a/src/vec/from_stream.rs b/src/vec/from_stream.rs index 8848bda3..692c7fa0 100644 --- a/src/vec/from_stream.rs +++ b/src/vec/from_stream.rs @@ -12,12 +12,12 @@ impl FromStream for Vec { { let stream = stream.into_stream(); - Pin::from(Box::new(async move { + Box::pin(async move { pin_utils::pin_mut!(stream); let mut out = vec![]; out.stream_extend(stream).await; out - })) + }) } }