forked from mirror/async-std
Use assert
without if
-clause
This commit is contained in:
parent
b68be72763
commit
85c32ef9d2
1 changed files with 3 additions and 6 deletions
|
@ -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…
Reference in a new issue