Skip to content

Commit 0845231

Browse files
committedMar 20, 2025
feat(rust): fix some clippy warnings
1 parent cdb54d4 commit 0845231

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed
 

‎implementations/rust/ockam/ockam_transport_tcp/src/portal/portal_worker.rs

+13-15
Original file line numberDiff line numberDiff line change
@@ -603,15 +603,13 @@ impl Worker for TcpPortalWorker {
603603
.map(|l| l.their_identifier())
604604
.ok();
605605

606-
if remote_packet {
607-
if their_identifier != self.their_identifier {
608-
debug!(
609-
"identifier changed from {:?} to {:?}",
610-
self.their_identifier.as_ref().map(|i| i.to_string()),
611-
their_identifier.as_ref().map(|i| i.to_string()),
612-
);
613-
return Err(TransportError::IdentifierChanged)?;
614-
}
606+
if remote_packet && their_identifier != self.their_identifier {
607+
debug!(
608+
"identifier changed from {:?} to {:?}",
609+
self.their_identifier.as_ref().map(|i| i.to_string()),
610+
their_identifier.as_ref().map(|i| i.to_string()),
611+
);
612+
return Err(TransportError::IdentifierChanged)?;
615613
}
616614

617615
let return_route = msg.return_route;
@@ -787,12 +785,12 @@ impl TcpPortalWorker {
787785
])
788786
.start(&tracer);
789787

790-
self.their_identifier
791-
.as_ref()
792-
.map(|i| span.set_attribute(KeyValue::new("expected_identifier", i.to_string())));
793-
their_identifier
794-
.as_ref()
795-
.map(|i| span.set_attribute(KeyValue::new("actual_identifier", i.to_string())));
788+
if let Some(i) = self.their_identifier.as_ref() {
789+
span.set_attribute(KeyValue::new("expected_identifier", i.to_string()))
790+
}
791+
if let Some(i) = their_identifier.as_ref() {
792+
span.set_attribute(KeyValue::new("actual_identifier", i.to_string()))
793+
}
796794
Ok(span)
797795
}
798796
}

0 commit comments

Comments
 (0)