diff --git a/futures-util/src/stream/try_stream/try_flatten_unordered.rs b/futures-util/src/stream/try_stream/try_flatten_unordered.rs index 25bdf2919b..db89ab34cf 100644 --- a/futures-util/src/stream/try_stream/try_flatten_unordered.rs +++ b/futures-util/src/stream/try_stream/try_flatten_unordered.rs @@ -113,7 +113,7 @@ where fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { let this = self.project(); if *this.last_item_is_error { - // `TryFlattenUnordered` won't poll the base stream again unless waker will be called explicitly. + // `FlattenUnordered` won't poll the base stream again unless waker will be called explicitly. *this.last_item_is_error = false; return Poll::Pending; @@ -135,9 +135,9 @@ where // // To do this, we return `Poll::Pending` on the next `poll_next` call, and call a waker only after the error // will be polled out from the error stream. - // As `TryFlattenUnordered` won't poll the base stream again unless waker will be called explicitly, we can be + // As `FlattenUnordered` won't poll the base stream again unless waker will be called explicitly, we can be // sure that by returning `Poll::Pending` we exclude the ability to poll the base stream before the error will reach the caller. - if out.as_ref().map_or(false, |opt| matches!(opt, Either::Right(_))) { + if out.as_ref().map_or(false, |item| matches!(item, Either::Right(_))) { *this.last_item_is_error = true; }