diff --git a/src/stream/stream/filter.rs b/src/stream/stream/filter.rs index 3fd54539..ad7b6d20 100644 --- a/src/stream/stream/filter.rs +++ b/src/stream/stream/filter.rs @@ -36,12 +36,10 @@ where let next = futures_core::ready!(self.as_mut().stream().poll_next(cx)); match next { - Some(v) => match (self.as_mut().predicate())(&v) { - true => Poll::Ready(Some(v)), - false => { - cx.waker().wake_by_ref(); - Poll::Pending - } + Some(v) if (self.as_mut().predicate())(&v) => Poll::Ready(Some(v)), + Some(_) => { + cx.waker().wake_by_ref(); + Poll::Pending }, None => Poll::Ready(None), } diff --git a/src/stream/stream/find.rs b/src/stream/stream/find.rs index 014c8b78..175477fe 100644 --- a/src/stream/stream/find.rs +++ b/src/stream/stream/find.rs @@ -36,12 +36,10 @@ where let item = futures_core::ready!(Pin::new(&mut *self.stream).poll_next(cx)); match item { - Some(v) => match (&mut self.p)(&v) { - true => Poll::Ready(Some(v)), - false => { - cx.waker().wake_by_ref(); - Poll::Pending - } + Some(v) if (&mut self.p)(&v) => Poll::Ready(Some(v)), + Some(_) => { + cx.waker().wake_by_ref(); + Poll::Pending }, None => Poll::Ready(None), } diff --git a/src/stream/stream/skip_while.rs b/src/stream/stream/skip_while.rs index a54b0510..e3fe26be 100644 --- a/src/stream/stream/skip_while.rs +++ b/src/stream/stream/skip_while.rs @@ -38,12 +38,9 @@ where match next { Some(v) => match self.as_mut().predicate() { - Some(p) => match p(&v) { - true => (), - false => { - *self.as_mut().predicate() = None; - return Poll::Ready(Some(v)); - } + Some(p) => if !p(&v) { + *self.as_mut().predicate() = None; + return Poll::Ready(Some(v)); }, None => return Poll::Ready(Some(v)), },