Skip to content

Commit cc670fd

Browse files
authored
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 c0e9368 commit cc670fd

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

futures-util/src/stream/stream/scan.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ where
115115

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

124124
delegate_sink!(stream, Item);
125125
}

0 commit comments

Comments
 (0)