Skip to content

Commit be123b2

Browse files
bors[bot]tirr-c
andauthored
Merge #198
198: Remove Unpin bound in `impl Stream for T` r=stjepang a=tirr-c I guess this is not needed anymore since we have `poll_next` that receives `Pin` now. The original bound is moved to `Stream::next`. Co-authored-by: Wonwoo Choi <[email protected]>
2 parents a4d42e7 + b70dfea commit be123b2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/stream/stream/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ pub trait Stream {
547547
}
548548
}
549549

550-
impl<T: futures_core::stream::Stream + Unpin + ?Sized> Stream for T {
550+
impl<T: futures_core::stream::Stream + ?Sized> Stream for T {
551551
type Item = <Self as futures_core::stream::Stream>::Item;
552552

553553
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {

src/stream/stream/scan.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use crate::task::{Context, Poll};
2-
31
use std::pin::Pin;
42

3+
use crate::stream::Stream;
4+
use crate::task::{Context, Poll};
5+
56
/// A stream to maintain state while polling another stream.
67
#[derive(Debug)]
78
pub struct Scan<S, St, F> {
@@ -25,7 +26,7 @@ impl<S: Unpin, St, F> Unpin for Scan<S, St, F> {}
2526

2627
impl<S, St, F, B> futures_core::stream::Stream for Scan<S, St, F>
2728
where
28-
S: futures_core::stream::Stream,
29+
S: Stream,
2930
F: FnMut(&mut St, S::Item) -> Option<B>,
3031
{
3132
type Item = B;

0 commit comments

Comments
 (0)