mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
io: fix trait bounds on impl Sink for StreamReader (#6647)
This impl had a bound on `StreamReader<S, E>`; this is incorrect because: - The second generic parameter to `StreamReader` is not an error type; it's a buffer type. - The `Stream` error type in `StreamReader` should not need to be the same as the `Sink` error type. This "passthrough" `Sink` impl was effectively unusable because it required the `Sink` error type be the same as the `StreamReader` buffer type. Resolve this by allowing the `StreamReader` buffer to be anything in this impl.
This commit is contained in:
parent
9a75d6f7f7
commit
ed4ddf443d
@ -326,7 +326,7 @@ impl<S, B> StreamReader<S, B> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: Sink<T, Error = E>, E, T> Sink<T> for StreamReader<S, E> {
|
||||
impl<S: Sink<T, Error = E>, B, E, T> Sink<T> for StreamReader<S, B> {
|
||||
type Error = E;
|
||||
fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||
self.project().inner.poll_ready(cx)
|
||||
|
Loading…
x
Reference in New Issue
Block a user