From c6a21047d791d84915eacf6e97bc3b68ad363ff9 Mon Sep 17 00:00:00 2001 From: Max Inden Date: Tue, 16 Mar 2021 13:22:42 +0100 Subject: [PATCH] protocols/relay: Ignore IdentifyEvent::Error (#2001) Co-authored-by: Roman Borschel --- protocols/relay/tests/lib.rs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/protocols/relay/tests/lib.rs b/protocols/relay/tests/lib.rs index 70584d8a..5699cba8 100644 --- a/protocols/relay/tests/lib.rs +++ b/protocols/relay/tests/lib.rs @@ -1112,18 +1112,15 @@ impl NetworkBehaviourEventProcess for CombinedBehaviour { impl NetworkBehaviourEventProcess for CombinedBehaviour { fn inject_event(&mut self, event: IdentifyEvent) { - match event { - IdentifyEvent::Received { - peer_id, - info: IdentifyInfo { listen_addrs, .. }, - .. - } => { - for addr in listen_addrs { - self.kad.add_address(&peer_id, addr); - } + if let IdentifyEvent::Received { + peer_id, + info: IdentifyInfo { listen_addrs, .. }, + .. + } = event + { + for addr in listen_addrs { + self.kad.add_address(&peer_id, addr); } - IdentifyEvent::Sent { .. } => {} - e => panic!("{:?}", e), } } }