From d6ffdbce8dada106315fd2d2bb9e44809904ee44 Mon Sep 17 00:00:00 2001 From: Wonwoo Choi Date: Mon, 16 Sep 2019 18:25:46 +0900 Subject: [PATCH 1/2] Remove Unpin bound in `impl Stream for T` --- src/stream/stream/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream/stream/mod.rs b/src/stream/stream/mod.rs index 24423b68..b0500c65 100644 --- a/src/stream/stream/mod.rs +++ b/src/stream/stream/mod.rs @@ -547,7 +547,7 @@ pub trait Stream { } } -impl Stream for T { +impl Stream for T { type Item = ::Item; fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { From b70dfeab15e134452d27c0d5c6ccb9a549f5c5a7 Mon Sep 17 00:00:00 2001 From: Wonwoo Choi Date: Mon, 16 Sep 2019 18:35:37 +0900 Subject: [PATCH 2/2] Require S: async_std::stream::Stream in Scan --- src/stream/stream/scan.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/stream/stream/scan.rs b/src/stream/stream/scan.rs index 4846144d..222022b8 100644 --- a/src/stream/stream/scan.rs +++ b/src/stream/stream/scan.rs @@ -1,7 +1,8 @@ -use crate::task::{Context, Poll}; - use std::pin::Pin; +use crate::stream::Stream; +use crate::task::{Context, Poll}; + /// A stream to maintain state while polling another stream. #[derive(Debug)] pub struct Scan { @@ -25,7 +26,7 @@ impl Unpin for Scan {} impl futures_core::stream::Stream for Scan where - S: futures_core::stream::Stream, + S: Stream, F: FnMut(&mut St, S::Item) -> Option, { type Item = B;