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 <chwo9843@gmail.com>
staging
bors[bot] 5 years ago committed by GitHub
commit be123b2ec5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -547,7 +547,7 @@ pub trait Stream {
}
}
impl<T: futures_core::stream::Stream + Unpin + ?Sized> Stream for T {
impl<T: futures_core::stream::Stream + ?Sized> Stream for T {
type Item = <Self as futures_core::stream::Stream>::Item;
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {

@ -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<S, St, F> {
@ -25,7 +26,7 @@ impl<S: Unpin, St, F> Unpin for Scan<S, St, F> {}
impl<S, St, F, B> futures_core::stream::Stream for Scan<S, St, F>
where
S: futures_core::stream::Stream,
S: Stream,
F: FnMut(&mut St, S::Item) -> Option<B>,
{
type Item = B;

Loading…
Cancel
Save