Skip to content

Commit

Permalink
Removed unnecessary parentheses + fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
olegnn committed Feb 17, 2020
1 parent 3bbfefe commit dae2bb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions futures-util/src/stream/stream/flat_map_unordered.rs
Expand Up @@ -347,8 +347,8 @@ where

if poll_state_value & NEED_TO_POLL != NONE
&& (polling_with_two_wakers
|| (poll_state_value & NEED_TO_POLL_FUTURES != NONE && !futures_will_be_woken
|| poll_state_value & NEED_TO_POLL_STREAM != NONE && !stream_will_be_woken))
|| poll_state_value & NEED_TO_POLL_FUTURES != NONE && !futures_will_be_woken
|| poll_state_value & NEED_TO_POLL_STREAM != NONE && !stream_will_be_woken)
{
ctx.waker().wake_by_ref();
}
Expand Down
4 changes: 3 additions & 1 deletion futures/tests/stream.rs
Expand Up @@ -45,6 +45,8 @@ fn flat_map_unordered() {
.collect::<Vec<_>>()
.await;

assert_eq!(fm_unordered.sort(), vec![0, 2, 4, 6, 8, 10, 0, 2].sort());
fm_unordered.sort();

assert_eq!(fm_unordered, vec![0, 0, 2, 2, 4, 6, 8, 10]);
});
}

0 comments on commit dae2bb9

Please sign in to comment.