Skip to content

Commit

Permalink
core/transport: Remove Sync bounds (#2667)
Browse files Browse the repository at this point in the history
With `Transport` becoming non-Clone and having `&mut` self receivers,
the `Sync` requirement no longer makes any sense and we can thus
remove it.
  • Loading branch information
thomaseizinger committed May 29, 2022
1 parent eba7634 commit 4aa84bf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/transport.rs
Expand Up @@ -152,7 +152,7 @@ pub trait Transport {
/// Boxes the transport, including custom transport errors.
fn boxed(self) -> boxed::Boxed<Self::Output>
where
Self: Transport + Sized + Send + Sync + 'static,
Self: Transport + Sized + Send + 'static,
Self::Dial: Send + 'static,
Self::Listener: Send + 'static,
Self::ListenerUpgrade: Send + 'static,
Expand Down
4 changes: 2 additions & 2 deletions core/src/transport/boxed.rs
Expand Up @@ -26,7 +26,7 @@ use std::{error::Error, fmt, io, pin::Pin};
/// Creates a new [`Boxed`] transport from the given transport.
pub fn boxed<T>(transport: T) -> Boxed<T::Output>
where
T: Transport + Send + Sync + 'static,
T: Transport + Send + 'static,
T::Error: Send + Sync,
T::Dial: Send + 'static,
T::Listener: Send + 'static,
Expand All @@ -41,7 +41,7 @@ where
/// and `ListenerUpgrade` futures are `Box`ed and only the `Output`
/// and `Error` types are captured in type variables.
pub struct Boxed<O> {
inner: Box<dyn Abstract<O> + Send + Sync>,
inner: Box<dyn Abstract<O> + Send>,
}

type Dial<O> = Pin<Box<dyn Future<Output = io::Result<O>> + Send>>;
Expand Down
2 changes: 1 addition & 1 deletion core/src/transport/upgrade.rs
Expand Up @@ -294,7 +294,7 @@ impl<T> Multiplexed<T> {
/// the [`StreamMuxer`] and custom transport errors.
pub fn boxed<M>(self) -> super::Boxed<(PeerId, StreamMuxerBox)>
where
T: Transport<Output = (PeerId, M)> + Sized + Send + Sync + 'static,
T: Transport<Output = (PeerId, M)> + Sized + Send + 'static,
T::Dial: Send + 'static,
T::Listener: Send + 'static,
T::ListenerUpgrade: Send + 'static,
Expand Down

0 comments on commit 4aa84bf

Please sign in to comment.