Skip to content

Commit

Permalink
Naming
Browse files Browse the repository at this point in the history
  • Loading branch information
olegnn committed May 31, 2022
1 parent 862bc9d commit 3f5c9a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions futures-util/src/stream/try_stream/try_flatten_unordered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ where
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
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;
Expand All @@ -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;
}

Expand Down

0 comments on commit 3f5c9a7

Please sign in to comment.