Use assert without if-clause

This commit is contained in:
Oleg Nosov 2020-02-07 22:45:15 +03:00
parent b68be72763
commit 85c32ef9d2
No known key found for this signature in database
GPG key ID: DE90B83800644E24

View file

@ -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!");
}
} }
} }