Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
andylokandy committed Jul 23, 2025
commit e8f3dc0bde5f3261c698b5e5006e69950825e6bf
15 changes: 4 additions & 11 deletions futures-util/src/stream/stream/buffer_unordered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,11 @@ where
}
}

// If we have any ready outputs, return the first one.
if let Some(output) = this.ready_queue.pop() {
// If there are still ready outputs, wake the task to poll again.
if !this.ready_queue.is_empty() {
cx.waker().wake_by_ref();
}

return Poll::Ready(Some(output));
}

// If more values are still coming from the stream, we're not done yet.
if this.stream.is_done() && this.in_progress_queue.is_empty() {
// If we have any ready outputs, return the first one.
Poll::Ready(Some(output))
} else if this.stream.is_done() && this.in_progress_queue.is_empty() {
// If more values are still coming from the stream, we're not done yet.
Poll::Ready(None)
} else {
Poll::Pending
Expand Down
15 changes: 4 additions & 11 deletions futures-util/src/stream/stream/buffered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,11 @@ where
}
}

// If we have any ready outputs, return the first one.
if let Some(output) = this.ready_queue.pop_front() {
// If there are still ready outputs, wake the task to poll again.
if !this.ready_queue.is_empty() {
cx.waker().wake_by_ref();
}

return Poll::Ready(Some(output));
}

// If more values are still coming from the stream, we're not done yet.
if this.stream.is_done() && this.in_progress_queue.is_empty() {
// If we have any ready outputs, return the first one.
Poll::Ready(Some(output))
} else if this.stream.is_done() && this.in_progress_queue.is_empty() {
// If more values are still coming from the stream, we're not done yet.
Poll::Ready(None)
} else {
Poll::Pending
Expand Down
Loading