Skip to content

Commit

Permalink
Fix Unusable Sink Implementation on scan (#2499)
Browse files Browse the repository at this point in the history
The current Sink implementation on stream::Scan requires the stream and
state types are the same which doesn't practically allow that
implementation to be used. This adds a separate generic to the Sink
implementation for state.
  • Loading branch information
drewkett authored and taiki-e committed Nov 23, 2021
1 parent 78fa3cd commit a363d26
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions futures-util/src/stream/stream/scan.rs
Expand Up @@ -118,11 +118,11 @@ where

// Forwarding impl of Sink from the underlying stream
#[cfg(feature = "sink")]
impl<S, Fut, F, Item> Sink<Item> for Scan<S, S, Fut, F>
impl<St, S, Fut, F, Item> Sink<Item> for Scan<St, S, Fut, F>
where
S: Stream + Sink<Item>,
St: Stream + Sink<Item>,
{
type Error = S::Error;
type Error = St::Error;

delegate_sink!(stream, Item);
}

0 comments on commit a363d26

Please sign in to comment.