Skip to content

Commit

Permalink
Merge #198
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bors[bot] and tirr-c authored Sep 16, 2019
2 parents a4d42e7 + b70dfea commit be123b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/stream/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>> {
Expand Down
7 changes: 4 additions & 3 deletions src/stream/stream/scan.rs
Original file line number Diff line number Diff line change
@@ -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> {
Expand All @@ -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;
Expand Down

0 comments on commit be123b2

Please sign in to comment.