diff options
| author | tv <tv@krebsco.de> | 2026-10-31 05:24:11 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-31 05:24:11 +0100 |
| commit | ec85763bf5345a394b6cad7c609867a4e04f659b (patch) | |
| tree | 29f9347e11dfb57241450c5919b44d4a42d57ca0 /src/transport/libp2p/errors.rs | |
| parent | d8a6cb52a8efcf8daa124dc97912e0d776beaf05 (diff) | |
libp2p: add without_peer helper
Diffstat (limited to 'src/transport/libp2p/errors.rs')
| -rw-r--r-- | src/transport/libp2p/errors.rs | 5 |
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(); |
