Skip to content

Commit

Permalink
Move Send + Sync bounds to higher layers
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed Jun 20, 2022
1 parent 6943ddb commit 37a23c4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/muxing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub trait StreamMuxer {
type OutboundSubstream;

/// Error type of the muxer
type Error: std::error::Error + Send + Sync + 'static;
type Error: std::error::Error;

/// Polls for a connection-wide event.
///
Expand Down
2 changes: 2 additions & 0 deletions core/src/muxing/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ impl<T> StreamMuxer for Wrap<T>
where
T: StreamMuxer,
T::Substream: AsyncRead + AsyncWrite + Send + Unpin + 'static,
T::Error: Send + Sync + 'static,
{
type Substream = SubstreamBox;
type OutboundSubstream = usize; // TODO: use a newtype
Expand Down Expand Up @@ -111,6 +112,7 @@ impl StreamMuxerBox {
T: StreamMuxer + Send + Sync + 'static,
T::OutboundSubstream: Send,
T::Substream: AsyncRead + AsyncWrite + Send + Unpin + 'static,
T::Error: Send + Sync + 'static,
{
let wrap = Wrap {
inner: muxer,
Expand Down
1 change: 1 addition & 0 deletions core/src/transport/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ impl<T> Multiplexed<T> {
M: StreamMuxer + Send + Sync + 'static,
M::Substream: AsyncRead + AsyncWrite + Send + Unpin + 'static,
M::OutboundSubstream: Send + 'static,
M::Error: Send + Sync + 'static,
{
boxed(self.map(|(i, m), _| (i, StreamMuxerBox::new(m))))
}
Expand Down

0 comments on commit 37a23c4

Please sign in to comment.