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 a479eb8 commit 27638ac
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
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
Expand Up @@ -39,6 +39,7 @@ impl<T> StreamMuxer for Wrap<T>
where
T: StreamMuxer,
T::Substream: 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: 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
Expand Up @@ -302,6 +302,7 @@ impl<T> Multiplexed<T> {
M: StreamMuxer + Send + Sync + 'static,
M::Substream: 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 27638ac

Please sign in to comment.