Skip to content
Open
Changes from all commits
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
Change condition for is_terminated in Zip
The condition for `is_terminated` in the `FusedStream` impl for `Zip` should check if either child stream has terminated. Otherwise, one stream may be polled even after it has been terminated if the other has not.
  • Loading branch information
haroldbruintjes authored Oct 30, 2024
commit cb684fdce856275521f88c3cf08f304f380f917f
2 changes: 1 addition & 1 deletion futures-util/src/stream/stream/zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ where
St2: Stream,
{
fn is_terminated(&self) -> bool {
self.stream1.is_terminated() && self.stream2.is_terminated()
self.stream1.is_terminated() || self.stream2.is_terminated()
}
}

Expand Down