From 85c32ef9d2fc661d1f951a5297a65298bd1842ce Mon Sep 17 00:00:00 2001 From: Oleg Nosov Date: Fri, 7 Feb 2020 22:45:15 +0300 Subject: [PATCH] Use `assert` without `if`-clause --- tests/stream.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/stream.rs b/tests/stream.rs index 58a441cd..e80fc99d 100644 --- a/tests/stream.rs +++ b/tests/stream.rs @@ -126,12 +126,9 @@ fn flat_map_doesnt_poll_completed_inner_stream() { type Item = (); fn poll_next(mut self: Pin<&mut Self>, _: &mut Context) -> Poll> { - if !self.polled { - self.polled = true; - Poll::Ready(None) - } else { - assert!(false, "Polled after completion!"); - } + assert!(!self.polled, "Polled after completion!"); + self.polled = true; + Poll::Ready(None) } }