Skip to content

Commit

Permalink
network-libp2p: Fix clippy warnings
Browse files Browse the repository at this point in the history
Fix clippy warnings in the `network-libp2p` subcrate.
  • Loading branch information
jsdanielh committed Sep 20, 2024
1 parent 3697040 commit d708a58
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions network-libp2p/src/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,11 @@ fn handle_event(
}

SwarmEvent::Dialing {
peer_id,
peer_id: Some(peer_id),
connection_id: _,
} => {
// This event is only triggered if the network behaviour performs the dial
if let Some(peer_id) = peer_id {
debug!(%peer_id, "Dialing peer");
}
debug!(%peer_id, "Dialing peer");
}

SwarmEvent::NewListenAddr {
Expand Down Expand Up @@ -809,9 +807,9 @@ fn handle_event(
if let Some(channel) = state.requests.remove(&request_id) {
// We might get empty responses (None) because of the implementation of our codecs.
let response = response
.ok_or_else(|| {
RequestError::OutboundRequest(OutboundRequestError::Timeout)
})
.ok_or(RequestError::OutboundRequest(
OutboundRequestError::Timeout,
))
.map(|data| data.into());

// The initiator of the request might no longer exist, so we
Expand Down

0 comments on commit d708a58

Please sign in to comment.