From cc21bdf068949aab18474972f402c5d327ca4f3e Mon Sep 17 00:00:00 2001 From: k-nasa Date: Tue, 1 Oct 2019 17:49:55 +0900 Subject: [PATCH] $cargo fmt --- src/stream/stream/filter.rs | 4 ++-- src/stream/stream/find.rs | 4 ++-- src/stream/stream/skip_while.rs | 10 ++++++---- src/task/sleepers.rs | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/stream/stream/filter.rs b/src/stream/stream/filter.rs index ad7b6d2..8ed282c 100644 --- a/src/stream/stream/filter.rs +++ b/src/stream/stream/filter.rs @@ -37,10 +37,10 @@ where match next { Some(v) if (self.as_mut().predicate())(&v) => Poll::Ready(Some(v)), - Some(_) => { + 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 175477f..93624c0 100644 --- a/src/stream/stream/find.rs +++ b/src/stream/stream/find.rs @@ -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)), + 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 e3fe26b..b1a8d9e 100644 --- a/src/stream/stream/skip_while.rs +++ b/src/stream/stream/skip_while.rs @@ -38,10 +38,12 @@ where match next { 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) { + *self.as_mut().predicate() = None; + return Poll::Ready(Some(v)); + } + } None => return Poll::Ready(Some(v)), }, None => return Poll::Ready(None), diff --git a/src/task/sleepers.rs b/src/task/sleepers.rs index b5902fb..4e70129 100644 --- a/src/task/sleepers.rs +++ b/src/task/sleepers.rs @@ -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(); }