Skip to content

Commit

Permalink
Remove various Sync bounds
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 authored and elenaf9 committed May 29, 2022
1 parent 607412d commit d7f5019
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 @@ -157,7 +157,7 @@ pub trait Transport {
/// Boxes the transport, including custom transport errors.
fn boxed(self) -> boxed::Boxed<Self::Output>
where
Self: Transport + Sized + Send + Sync + Unpin + 'static,
Self: Transport + Sized + Send + Unpin + 'static,
Self::Dial: Send + 'static,
Self::ListenerUpgrade: Send + 'static,
Self::Error: Send + Sync,
Expand Down
4 changes: 2 additions & 2 deletions core/src/transport/boxed.rs
Expand Up @@ -31,7 +31,7 @@ use std::{
/// Creates a new [`Boxed`] transport from the given transport.
pub fn boxed<T>(transport: T) -> Boxed<T::Output>
where
T: Transport + Send + Sync + Unpin + 'static,
T: Transport + Send + Unpin + 'static,
T::Error: Send + Sync,
T::Dial: Send + 'static,
T::ListenerUpgrade: Send + 'static,
Expand All @@ -45,7 +45,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 + Unpin>,
inner: Box<dyn Abstract<O> + Send + Unpin>,
}

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 @@ -295,7 +295,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 + Unpin + 'static,
T: Transport<Output = (PeerId, M)> + Sized + Send + Unpin + 'static,
T::Dial: Send + 'static,
T::ListenerUpgrade: Send + 'static,
T::Error: Send + Sync,
Expand Down

0 comments on commit d7f5019

Please sign in to comment.