Skip to content

Commit f562050

Browse files
drewketttaiki-e
authored andcommitted
Fix Unusable Sink Implementation on scan (#2499)
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.
1 parent 9080b83 commit f562050

File tree

1 file changed

+3
-3
lines changed
  • futures-util/src/stream/stream

1 file changed

+3
-3
lines changed

Diff for: futures-util/src/stream/stream/scan.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ where
118118

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

127127
delegate_sink!(stream, Item);
128128
}

0 commit comments

Comments
 (0)