Use `assert` without `if`-clause

pull/701/head
Oleg Nosov 5 years ago
parent b68be72763
commit 85c32ef9d2
No known key found for this signature in database
GPG Key ID: DE90B83800644E24

@ -126,12 +126,9 @@ fn flat_map_doesnt_poll_completed_inner_stream() {
type Item = (); type Item = ();
fn poll_next(mut self: Pin<&mut Self>, _: &mut Context) -> Poll<Option<Self::Item>> { fn poll_next(mut self: Pin<&mut Self>, _: &mut Context) -> Poll<Option<Self::Item>> {
if !self.polled { assert!(!self.polled, "Polled after completion!");
self.polled = true; self.polled = true;
Poll::Ready(None) Poll::Ready(None)
} else {
assert!(false, "Polled after completion!");
}
} }
} }

Loading…
Cancel
Save