2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-04-10 10:26:42 +00:00

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 = ();
fn poll_next(mut self: Pin<&mut Self>, _: &mut Context) -> Poll<Option<Self::Item>> {
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)
}
}