Skip to content

Commit

Permalink
Change condition for is_terminated in Zip
Browse files Browse the repository at this point in the history
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
1 parent 7211cb7 commit cb684fd
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit cb684fd

Please sign in to comment.