Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Oct 8, 2023
1 parent 5014087 commit aec063d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
16 changes: 7 additions & 9 deletions libp2p/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,13 @@ mod tests {
// Closure can either return a Transport directly.
.with_other_transport(|_| DummyTransport::<(PeerId, StreamMuxerBox)>::new())?
// Or a Result containing a Transport.
.with_other_transport(
|_| {
if true {
Ok(DummyTransport::<(PeerId, StreamMuxerBox)>::new())
} else {
Err(Box::from("test"))
}
},
)?
.with_other_transport(|_| {
if true {
Ok(DummyTransport::<(PeerId, StreamMuxerBox)>::new())
} else {
Err(Box::from("test"))
}
})?
.with_behaviour(|_| libp2p_swarm::dummy::Behaviour)
.unwrap()
.build();
Expand Down
5 changes: 4 additions & 1 deletion libp2p/src/builder/phase/other_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ mod private {

impl<T: Transport> private::Sealed<Infallible> for T {}

impl<T: Transport> private::Sealed<TransportError> for Result<T, Box<dyn std::error::Error + Send + Sync>> {}
impl<T: Transport> private::Sealed<TransportError>
for Result<T, Box<dyn std::error::Error + Send + Sync>>
{
}

#[derive(Debug, thiserror::Error)]
#[error("failed to build transport: {0}")]
Expand Down

0 comments on commit aec063d

Please sign in to comment.