mirror of
https://github.com/async-rs/async-std.git
synced 2025-04-24 17:26:51 +00:00
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 <chwo9843@gmail.com>
This commit is contained in:
commit
be123b2ec5
2 changed files with 5 additions and 4 deletions
|
@ -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;
|
type Item = <Self as futures_core::stream::Stream>::Item;
|
||||||
|
|
||||||
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::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 std::pin::Pin;
|
||||||
|
|
||||||
|
use crate::stream::Stream;
|
||||||
|
use crate::task::{Context, Poll};
|
||||||
|
|
||||||
/// A stream to maintain state while polling another stream.
|
/// A stream to maintain state while polling another stream.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Scan<S, St, F> {
|
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>
|
impl<S, St, F, B> futures_core::stream::Stream for Scan<S, St, F>
|
||||||
where
|
where
|
||||||
S: futures_core::stream::Stream,
|
S: Stream,
|
||||||
F: FnMut(&mut St, S::Item) -> Option<B>,
|
F: FnMut(&mut St, S::Item) -> Option<B>,
|
||||||
{
|
{
|
||||||
type Item = B;
|
type Item = B;
|
||||||
|
|
Loading…
Reference in a new issue