Skip to content

Commit 04c2e64

Browse files
committed
Small readability improvement
1 parent 05fe824 commit 04c2e64

File tree

1 file changed

+4
-11
lines changed
  • protocols/request-response/src

1 file changed

+4
-11
lines changed

protocols/request-response/src/lib.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -708,18 +708,11 @@ where
708708
}
709709
}
710710

711-
fn on_dial_failure(
712-
&mut self,
713-
DialFailure {
714-
peer_id,
715-
connection_id,
716-
..
717-
}: DialFailure,
718-
) {
719-
let key = if let Some(peer_id) = peer_id {
711+
fn on_dial_failure(&mut self, failure: DialFailure) {
712+
let key = if let Some(peer_id) = failure.peer_id {
720713
peer_id.into()
721714
} else {
722-
connection_id.into()
715+
failure.connection_id.into()
723716
};
724717

725718
// If there are pending outgoing requests when a dial failure occurs,
@@ -732,7 +725,7 @@ where
732725
for request in pending {
733726
self.pending_events
734727
.push_back(ToSwarm::GenerateEvent(Event::OutboundFailure {
735-
peer: peer_id,
728+
peer: failure.peer_id,
736729
request_id: request.request_id,
737730
error: OutboundFailure::DialFailure,
738731
}));

0 commit comments

Comments
 (0)