forked from mirror/async-std
Require S: async_std::stream::Stream in Scan
This commit is contained in:
parent
d6ffdbce8d
commit
b70dfeab15
1 changed files with 4 additions and 3 deletions
|
@ -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…
Reference in a new issue