chore: formatting in select! macro

This commit is contained in:
Byron Hambly 2022-08-04 14:27:50 +02:00
parent ec169916d6
commit dc68344b62
No known key found for this signature in database
GPG Key ID: DE8F6EA20A661697

View File

@ -148,7 +148,7 @@ impl EventLoop {
swarm_event = self.swarm.select_next_some() => { swarm_event = self.swarm.select_next_some() => {
match swarm_event { match swarm_event {
SwarmEvent::ConnectionEstablished { peer_id, endpoint, .. } => { SwarmEvent::ConnectionEstablished { peer_id, endpoint, .. } => {
if peer_id == self.rendezvous_peer_id{ if peer_id == self.rendezvous_peer_id {
tracing::info!( tracing::info!(
"Connected to rendezvous point, discovering nodes in '{}' namespace ...", "Connected to rendezvous point, discovering nodes in '{}' namespace ...",
self.namespace self.namespace
@ -167,26 +167,25 @@ impl EventLoop {
} }
SwarmEvent::OutgoingConnectionError { peer_id, error } => { SwarmEvent::OutgoingConnectionError { peer_id, error } => {
if let Some(peer_id_from_error) = peer_id { if let Some(peer_id_from_error) = peer_id {
if peer_id_from_error == self.rendezvous_peer_id { if peer_id_from_error == self.rendezvous_peer_id {
tracing::error!( tracing::error!(
"Failed to connect to rendezvous point at {}: {}", "Failed to connect to rendezvous point at {}: {}",
&self.rendezvous_addr, &self.rendezvous_addr,
error error
); );
// if the rendezvous node is unreachable we just stop // if the rendezvous node is unreachable we just stop
return Vec::new(); return Vec::new();
} else { } else {
tracing::error!( tracing::error!(
"You connected to the wrong Peer: {} Error: {}", "You connected to the wrong Peer: {} Error: {}",
&peer_id_from_error, &peer_id_from_error,
error error
); );
// if for some reason the peer is not the same it will return empty too. // if for some reason the peer is not the same it will return empty too.
// this is just for the CLI to not get stuck // this is just for the CLI to not get stuck
return Vec::new(); return Vec::new();
} }
} else { } else {
tracing::debug!( tracing::debug!(
"Failed to connect to peer at {}: {}", "Failed to connect to peer at {}: {}",