Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/stream/stream/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use crate::task::{Context, Poll};
pub struct AllFuture<'a, S, F, T> {
pub(crate) stream: &'a mut S,
pub(crate) f: F,
pub(crate) result: bool,
pub(crate) _marker: PhantomData<T>,
}

Expand All @@ -19,7 +18,6 @@ impl<'a, S, F, T> AllFuture<'a, S, F, T> {
Self {
stream,
f,
result: true, // the default if the empty stream
_marker: PhantomData,
}
}
Expand All @@ -40,7 +38,6 @@ where
match next {
Some(v) => {
let result = (&mut self.f)(v);
self.result = result;

if result {
// don't forget to wake this task again to pull the next item from stream
Expand All @@ -50,7 +47,7 @@ where
Poll::Ready(false)
}
}
None => Poll::Ready(self.result),
None => Poll::Ready(true),
}
}
}
5 changes: 1 addition & 4 deletions src/stream/stream/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use crate::task::{Context, Poll};
pub struct AnyFuture<'a, S, F, T> {
pub(crate) stream: &'a mut S,
pub(crate) f: F,
pub(crate) result: bool,
pub(crate) _marker: PhantomData<T>,
}

Expand All @@ -19,7 +18,6 @@ impl<'a, S, F, T> AnyFuture<'a, S, F, T> {
Self {
stream,
f,
result: false, // the default if the empty stream
_marker: PhantomData,
}
}
Expand All @@ -40,7 +38,6 @@ where
match next {
Some(v) => {
let result = (&mut self.f)(v);
self.result = result;

if result {
Poll::Ready(true)
Expand All @@ -50,7 +47,7 @@ where
Poll::Pending
}
}
None => Poll::Ready(self.result),
None => Poll::Ready(false),
}
}
}