Skip to content

Commit

Permalink
Put Error + Send + Sync bounds directly on StreamMuxer::Error
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed Jun 20, 2022
1 parent 32c477a commit a479eb8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
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;
type Error: std::error::Error + Send + Sync + 'static;

/// Polls for a connection-wide event.
///
Expand Down
4 changes: 1 addition & 3 deletions core/src/muxing/boxed.rs
Expand Up @@ -39,7 +39,6 @@ impl<T> StreamMuxer for Wrap<T>
where
T: StreamMuxer,
T::Substream: Send + Unpin + 'static,
T::Error: Into<Box<dyn Error + Send + Sync>>,
{
type Substream = SubstreamBox;
type OutboundSubstream = usize; // TODO: use a newtype
Expand Down Expand Up @@ -100,7 +99,7 @@ where

fn into_io_error<E>(err: E) -> io::Error
where
E: Into<Box<dyn Error + Send + Sync>>,
E: Error + Send + Sync + 'static,
{
io::Error::new(io::ErrorKind::Other, err)
}
Expand All @@ -112,7 +111,6 @@ impl StreamMuxerBox {
T: StreamMuxer + Send + Sync + 'static,
T::OutboundSubstream: Send,
T::Substream: Send + Unpin + 'static,
T::Error: Into<Box<dyn Error + Send + Sync>>,
{
let wrap = Wrap {
inner: muxer,
Expand Down
1 change: 0 additions & 1 deletion core/src/transport/upgrade.rs
Expand Up @@ -302,7 +302,6 @@ impl<T> Multiplexed<T> {
M: StreamMuxer + Send + Sync + 'static,
M::Substream: Send + Unpin + 'static,
M::OutboundSubstream: Send + 'static,
M::Error: Into<Box<dyn Error + Send + Sync>>,
{
boxed(self.map(|(i, m), _| (i, StreamMuxerBox::new(m))))
}
Expand Down

0 comments on commit a479eb8

Please sign in to comment.