@ -37,10 +37,10 @@ where
match next {
Some(v) if (self.as_mut().predicate())(&v) => Poll::Ready(Some(v)),
Some(_) => {
cx.waker().wake_by_ref();
Poll::Pending
},
}
None => Poll::Ready(None),
@ -36,11 +36,11 @@ where
let item = futures_core::ready!(Pin::new(&mut *self.stream).poll_next(cx));
match item {
Some(v) if (&mut self.p)(&v) => Poll::Ready(Some(v)),
@ -38,10 +38,12 @@ where
Some(v) => match self.as_mut().predicate() {
Some(p) => if !p(&v) {
*self.as_mut().predicate() = None;
return Poll::Ready(Some(v));
Some(p) => {
if !p(&v) {
None => return Poll::Ready(Some(v)),
None => return Poll::Ready(None),
@ -30,7 +30,7 @@ impl Sleepers {
pub fn wait(&self) {
let mut sleep = self.sleep.lock().unwrap();
if !self.notified.swap(false, Ordering::SeqCst){
if !self.notified.swap(false, Ordering::SeqCst) {
*sleep += 1;
let _ = self.wake.wait(sleep).unwrap();