From dae2bb9fcb81db829026e65b743779dd1f4ef897 Mon Sep 17 00:00:00 2001 From: olegnn Date: Mon, 17 Feb 2020 18:56:15 +0300 Subject: [PATCH] Removed unnecessary parentheses + fixed test --- futures-util/src/stream/stream/flat_map_unordered.rs | 4 ++-- futures/tests/stream.rs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/futures-util/src/stream/stream/flat_map_unordered.rs b/futures-util/src/stream/stream/flat_map_unordered.rs index 2d4cadcf32..89720bdef6 100644 --- a/futures-util/src/stream/stream/flat_map_unordered.rs +++ b/futures-util/src/stream/stream/flat_map_unordered.rs @@ -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(); } diff --git a/futures/tests/stream.rs b/futures/tests/stream.rs index bf8bb9adbe..d109b12400 100644 --- a/futures/tests/stream.rs +++ b/futures/tests/stream.rs @@ -45,6 +45,8 @@ fn flat_map_unordered() { .collect::>() .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]); }); }