Skip to content

Commit 94ca59d

Browse files
authored
Fix incorrect assumption (#2606)
1 parent 7a4fc6e commit 94ca59d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

futures-util/src/stream/stream/flatten_unordered.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,8 @@ impl SharedPollState {
9999
})
100100
.ok()?;
101101

102-
debug_assert!(value & WAKING == NONE);
103-
104-
// Only start the waking process if we're not in the polling phase and the stream isn't woken already
105-
if value & (WOKEN | POLLING) == NONE {
102+
// Only start the waking process if we're not in the polling/waking phase and the stream isn't woken already
103+
if value & (WOKEN | POLLING | WAKING) == NONE {
106104
let bomb = PollStateBomb::new(self, SharedPollState::stop_waking);
107105

108106
Some((value, bomb))
@@ -236,7 +234,7 @@ impl ArcWake for WrappedWaker {
236234
}
237235

238236
pin_project! {
239-
/// Future which contains optional stream.
237+
/// Future which polls optional inner stream.
240238
///
241239
/// If it's `Some`, it will attempt to call `poll_next` on it,
242240
/// returning `Some((item, next_item_fut))` in case of `Poll::Ready(Some(...))`

0 commit comments

Comments
 (0)