You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The condition where both streams are done is already covered by the check in is_terminated. In other words, before calling is_terminated, the following holds:
Let's assume self.stream.is_done() && self.other_stream.is_done(). Fuse::is_done returns true only if polled at least once, implying ZipLatestWith was polled at least once. In the match expression to compute the new state, the first arm could not have been chosen because it implies a new item was just yielded, which implies is_done returns false for the corresponding stream. If the second or third arm was chosen, both states were set to Nothing. The fifth arm could not have been chosen because the fourth arm has a wildcard with a predicate that is our hypothesis, so it would have been chosen and would have set both states to Nothing. Thus, the hypothesis that both streams are done before calling is_terminated implies that both states are Nothing, which implies the existing implementation of is_terminated already handles that case.
In the main
poll_next
implementation ofZipLatestWith
there are three conditions that could result in termination:However, the
FusedStream::is_terminated
implementation only covers the first two of these cases:I propose that the
is_terminated
implementation needs to be changed to this (or something logically equivalent):The text was updated successfully, but these errors were encountered: