summaryrefslogtreecommitdiffstats
path: root/src/swarm/peer/inbound.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-26 21:56:20 +0100
committertv <tv@krebsco.de>2026-10-26 21:56:20 +0100
commit08f5df1f0a2e22876a5b49a4f9e2e05a61df882a (patch)
tree113050df0bef5e8f3e9d188c69fc2a0c76d2eb17 /src/swarm/peer/inbound.rs
parentecdb3ee944f5c171faac3a71117e2ff27e064295 (diff)
make clippy happy again
Diffstat (limited to 'src/swarm/peer/inbound.rs')
-rw-r--r--src/swarm/peer/inbound.rs20
1 files changed, 10 insertions, 10 deletions
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.