From 08f5df1f0a2e22876a5b49a4f9e2e05a61df882a Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 26 Oct 2026 21:56:20 +0100 Subject: make clippy happy again --- src/swarm/peer/inbound.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/swarm/peer/inbound.rs') diff --git a/src/swarm/peer/inbound.rs b/src/swarm/peer/inbound.rs index 73cc629..745e646 100644 --- a/src/swarm/peer/inbound.rs +++ b/src/swarm/peer/inbound.rs @@ -33,12 +33,12 @@ pub(crate) async fn handle_message( // A reply to a HELLO from an earlier run of ours (late, or queued in Mycelium while // we were down) says nothing about now; the peer answers our current HELLO. - if let transport::ParsedMessage::HelloReply(reply) = &message { - if reply.run_id != state.run_id { - state.stats.stale_hello_reply(); - debug!(peer = %peer, "Ignoring a HELLO_REPLY to a HELLO from an earlier run"); - return Ok(()); - } + if let transport::ParsedMessage::HelloReply(reply) = &message + && reply.run_id != state.run_id + { + state.stats.stale_hello_reply(); + debug!(peer = %peer, "Ignoring a HELLO_REPLY to a HELLO from an earlier run"); + return Ok(()); } if !admit(state, &peer, &message).await { @@ -84,10 +84,10 @@ pub(crate) async fn handle_message( debug!(peer = %peer, "HELLO before we know our swarm; not answering yet"); return Ok(()); }; - if let Some(theirs) = &hello.swarm_id { - if theirs != &swarm_id { - bail!("Incompatible swarm at {peer}: ours is {swarm_id}, it claims {theirs}"); - } + if let Some(theirs) = &hello.swarm_id + && theirs != &swarm_id + { + bail!("Incompatible swarm at {peer}: ours is {swarm_id}, it claims {theirs}"); } // A resent HELLO (our reply was lost) or a late copy of one repeats a // handshake we answered already: it must not reset the session again. -- cgit v1.3.1