aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/libp2p/errors.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 05:24:11 +0100
committertv <tv@krebsco.de>2026-10-31 05:24:11 +0100
commitec85763bf5345a394b6cad7c609867a4e04f659b (patch)
tree29f9347e11dfb57241450c5919b44d4a42d57ca0 /src/transport/libp2p/errors.rs
parentd8a6cb52a8efcf8daa124dc97912e0d776beaf05 (diff)
libp2p: add without_peer helper
Diffstat (limited to 'src/transport/libp2p/errors.rs')
-rw-r--r--src/transport/libp2p/errors.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/transport/libp2p/errors.rs b/src/transport/libp2p/errors.rs
index 7eb4551..e024b1c 100644
--- a/src/transport/libp2p/errors.rs
+++ b/src/transport/libp2p/errors.rs
@@ -14,10 +14,7 @@ pub(super) fn describe_dial_error(error: &::libp2p::swarm::DialError) -> String
let described: Vec<String> = errors
.iter()
.map(|(address, error)| {
- let mut address = address.clone();
- if let Some(Protocol::P2p(_)) = address.iter().last() {
- address.pop();
- }
+ let address = without_peer(address.clone());
format!("{address}: {}", innermost_causes(error))
})
.collect();