Skip to content

Commit

Permalink
fixup! Re-design the StreamMuxer trait
Browse files Browse the repository at this point in the history
Use `Bytes::new` to reduce diff and properly format bounds.
  • Loading branch information
thomaseizinger committed Jun 3, 2022
1 parent ae40bde commit ad34171
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions muxers/mplex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ where

/// Active substream to the remote.
pub struct Substream<C>
where
C: AsyncRead + AsyncWrite + Unpin,
where
C: AsyncRead + AsyncWrite + Unpin,
{
/// The unique, local identifier of the substream.
id: LocalStreamId,
Expand All @@ -202,13 +202,13 @@ pub struct Substream<C>
}

impl<C> Substream<C>
where
C: AsyncRead + AsyncWrite + Unpin,
where
C: AsyncRead + AsyncWrite + Unpin,
{
fn new(id: LocalStreamId, io: Arc<Mutex<io::Multiplexed<C>>>) -> Self {
Self {
id,
current_data: Bytes::default(),
current_data: Bytes::new(),
io,
}
}
Expand Down

0 comments on commit ad34171

Please sign in to comment.