merge_streams: shorten the code a tiny bit
This commit is contained in:
parent
d9a56acacb
commit
decf29a910
1 changed files with 1 additions and 5 deletions
|
|
@ -36,11 +36,7 @@ fn poll_two<I, S1: Stream<Item = I> + Unpin, S2: Stream<Item = I> + Unpin>(
|
||||||
let s1p = s1.poll_next_unpin(cx);
|
let s1p = s1.poll_next_unpin(cx);
|
||||||
match s1p {
|
match s1p {
|
||||||
Poll::Ready(Some(v)) => Poll::Ready(Some(v)),
|
Poll::Ready(Some(v)) => Poll::Ready(Some(v)),
|
||||||
Poll::Ready(None) => match s2.poll_next_unpin(cx) {
|
Poll::Ready(None) => s2.poll_next_unpin(cx),
|
||||||
Poll::Ready(Some(v)) => Poll::Ready(Some(v)),
|
|
||||||
Poll::Ready(None) => Poll::Ready(None),
|
|
||||||
Poll::Pending => Poll::Pending,
|
|
||||||
},
|
|
||||||
Poll::Pending => match s2.poll_next_unpin(cx) {
|
Poll::Pending => match s2.poll_next_unpin(cx) {
|
||||||
Poll::Ready(Some(v)) => Poll::Ready(Some(v)),
|
Poll::Ready(Some(v)) => Poll::Ready(Some(v)),
|
||||||
Poll::Ready(None) | Poll::Pending => Poll::Pending,
|
Poll::Ready(None) | Poll::Pending => Poll::Pending,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue