]> git.feebdaed.xyz Git - 0xmirror/tokio.git/commitdiff
codec: remove unnecessary trait bounds on all `Framed` constructors (#7716)
authorConrad Ludgate <conradludgate@gmail.com>
Wed, 29 Oct 2025 12:08:13 +0000 (12:08 +0000)
committerGitHub <noreply@github.com>
Wed, 29 Oct 2025 12:08:13 +0000 (20:08 +0800)
tokio-util/src/codec/framed.rs
tokio-util/src/codec/framed_read.rs
tokio-util/src/codec/framed_write.rs

index ec7aa172f0b2ad82ea90f0bbdb080e9085d436b0..d36248bc9b73a8e20c6f351fd668e93cead193e2 100644 (file)
@@ -41,10 +41,7 @@ pin_project! {
     }
 }
 
-impl<T, U> Framed<T, U>
-where
-    T: AsyncRead + AsyncWrite,
-{
+impl<T, U> Framed<T, U> {
     /// Provides a [`Stream`] and [`Sink`] interface for reading and writing to this
     /// I/O object, using [`Decoder`] and [`Encoder`] to read and write the raw data.
     ///
@@ -127,9 +124,7 @@ where
             },
         }
     }
-}
 
-impl<T, U> Framed<T, U> {
     /// Provides a [`Stream`] and [`Sink`] interface for reading and writing to this
     /// I/O object, using [`Decoder`] and [`Encoder`] to read and write the raw data.
     ///
index 0f2e16dc3421b2d80c9949c5275396bafe44c0ef..66cf7ef411de4b8f71aeb8ec5b899cbddd56ede6 100644 (file)
@@ -36,11 +36,7 @@ pin_project! {
 
 // ===== impl FramedRead =====
 
-impl<T, D> FramedRead<T, D>
-where
-    T: AsyncRead,
-    D: Decoder,
-{
+impl<T, D> FramedRead<T, D> {
     /// Creates a new `FramedRead` with the given `decoder`.
     pub fn new(inner: T, decoder: D) -> FramedRead<T, D> {
         FramedRead {
@@ -68,9 +64,7 @@ where
             },
         }
     }
-}
 
-impl<T, D> FramedRead<T, D> {
     /// Returns a reference to the underlying I/O stream wrapped by
     /// `FramedRead`.
     ///
index efc369ebfad66132a6ada02f4dbeb7d0831b8faa..db80f5b443ffc4aab3c54618c8f913ceed9dae5d 100644 (file)
@@ -35,10 +35,7 @@ pin_project! {
     }
 }
 
-impl<T, E> FramedWrite<T, E>
-where
-    T: AsyncWrite,
-{
+impl<T, E> FramedWrite<T, E> {
     /// Creates a new `FramedWrite` with the given `encoder`.
     pub fn new(inner: T, encoder: E) -> FramedWrite<T, E> {
         FramedWrite {
@@ -64,9 +61,7 @@ where
             },
         }
     }
-}
 
-impl<T, E> FramedWrite<T, E> {
     /// Returns a reference to the underlying I/O stream wrapped by
     /// `FramedWrite`.
     ///