Skip to content

Commit 28dfa30

Browse files
LunaBorowskacramertj
authored andcommitted
Refactor StreamExt#forward type bounds
This makes the bounds easier to understand in documentation by removing bounds referring to each other. Previously, the bounds in documentation appeared as such: S: Sink<Self::Ok>, Self: TryStream<Error = <S as Sink<Self::Ok>>::Error>, This changes them to the following simpler to understand form. S: Sink<Self::Ok, Error = Self::Error>, Self: TryStream,
1 parent 9c1b2d4 commit 28dfa30

File tree

1 file changed

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

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,8 +1231,8 @@ pub trait StreamExt: Stream {
12311231
#[cfg(feature = "sink")]
12321232
fn forward<S>(self, sink: S) -> Forward<Self, S>
12331233
where
1234-
S: Sink<<Self as TryStream>::Ok>,
1235-
Self: TryStream<Error = S::Error> + Sized,
1234+
S: Sink<Self::Ok, Error = Self::Error>,
1235+
Self: TryStream + Sized,
12361236
{
12371237
Forward::new(self, sink)
12381238
}

0 commit comments

Comments
 (0)