Skip to content

Commit 4421022

Browse files
codec: remove unnecessary trait bounds on all Framed constructors (#7716)
1 parent 5a709e3 commit 4421022

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

tokio-util/src/codec/framed.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ pin_project! {
4141
}
4242
}
4343

44-
impl<T, U> Framed<T, U>
45-
where
46-
T: AsyncRead + AsyncWrite,
47-
{
44+
impl<T, U> Framed<T, U> {
4845
/// Provides a [`Stream`] and [`Sink`] interface for reading and writing to this
4946
/// I/O object, using [`Decoder`] and [`Encoder`] to read and write the raw data.
5047
///
@@ -127,9 +124,7 @@ where
127124
},
128125
}
129126
}
130-
}
131127

132-
impl<T, U> Framed<T, U> {
133128
/// Provides a [`Stream`] and [`Sink`] interface for reading and writing to this
134129
/// I/O object, using [`Decoder`] and [`Encoder`] to read and write the raw data.
135130
///

tokio-util/src/codec/framed_read.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ pin_project! {
3636

3737
// ===== impl FramedRead =====
3838

39-
impl<T, D> FramedRead<T, D>
40-
where
41-
T: AsyncRead,
42-
D: Decoder,
43-
{
39+
impl<T, D> FramedRead<T, D> {
4440
/// Creates a new `FramedRead` with the given `decoder`.
4541
pub fn new(inner: T, decoder: D) -> FramedRead<T, D> {
4642
FramedRead {
@@ -68,9 +64,7 @@ where
6864
},
6965
}
7066
}
71-
}
7267

73-
impl<T, D> FramedRead<T, D> {
7468
/// Returns a reference to the underlying I/O stream wrapped by
7569
/// `FramedRead`.
7670
///

tokio-util/src/codec/framed_write.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ pin_project! {
3535
}
3636
}
3737

38-
impl<T, E> FramedWrite<T, E>
39-
where
40-
T: AsyncWrite,
41-
{
38+
impl<T, E> FramedWrite<T, E> {
4239
/// Creates a new `FramedWrite` with the given `encoder`.
4340
pub fn new(inner: T, encoder: E) -> FramedWrite<T, E> {
4441
FramedWrite {
@@ -64,9 +61,7 @@ where
6461
},
6562
}
6663
}
67-
}
6864

69-
impl<T, E> FramedWrite<T, E> {
7065
/// Returns a reference to the underlying I/O stream wrapped by
7166
/// `FramedWrite`.
7267
///

0 commit comments

Comments
 (0)