diff --git a/src/stream/stream/mod.rs b/src/stream/stream/mod.rs index 24423b6..b0500c6 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> { diff --git a/src/stream/stream/scan.rs b/src/stream/stream/scan.rs index 4846144..222022b 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;