From 572ed906bea582e574f08175137ad08629e6ff85 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 19 Apr 2023 22:14:32 +0200 Subject: [PATCH] Fix compile errors --- protocols/gossipsub/src/handler.rs | 6 +++--- swarm/src/behaviour.rs | 3 +++ swarm/src/handler.rs | 4 ++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/protocols/gossipsub/src/handler.rs b/protocols/gossipsub/src/handler.rs index 5f32346f0b9..928989fa028 100644 --- a/protocols/gossipsub/src/handler.rs +++ b/protocols/gossipsub/src/handler.rs @@ -559,9 +559,9 @@ impl ConnectionHandler for Handler { log::debug!("Protocol negotiation failed: {e}") } ConnectionEvent::AddressChange(_) - | ConnectionEvent::ListenUpgradeError(_) - | ConnectionEvent::LocalProtocolsChange(_) - | ConnectionEvent::RemoteProtocolsChange(_) => {} + | ConnectionEvent::ListenUpgradeError(_) + | ConnectionEvent::LocalProtocolsChange(_) + | ConnectionEvent::RemoteProtocolsChange(_) => {} } } Handler::Disabled(_) => {} diff --git a/swarm/src/behaviour.rs b/swarm/src/behaviour.rs index 9fd014bdc47..92604f8fb07 100644 --- a/swarm/src/behaviour.rs +++ b/swarm/src/behaviour.rs @@ -294,6 +294,9 @@ pub trait PollParameters { /// The iterator's elements are the ASCII names as reported on the wire. /// /// Note that the list is computed once at initialization and never refreshed. + #[deprecated( + note = "Use `libp2p_swarm::SupportedProtocols` in your `ConnectionHandler` instead." + )] fn supported_protocols(&self) -> Self::SupportedProtocolsIter; /// Returns the list of the addresses we're listening on. diff --git a/swarm/src/handler.rs b/swarm/src/handler.rs index 40fc49673c4..3cb52d56d37 100644 --- a/swarm/src/handler.rs +++ b/swarm/src/handler.rs @@ -231,6 +231,8 @@ impl<'a, IP: InboundUpgradeSend, OP: OutboundUpgradeSend, IOI, OOI> } ConnectionEvent::FullyNegotiatedInbound(_) | ConnectionEvent::AddressChange(_) + | ConnectionEvent::LocalProtocolsChange(_) + | ConnectionEvent::RemoteProtocolsChange(_) | ConnectionEvent::ListenUpgradeError(_) => false, } } @@ -247,6 +249,8 @@ impl<'a, IP: InboundUpgradeSend, OP: OutboundUpgradeSend, IOI, OOI> ConnectionEvent::FullyNegotiatedOutbound(_) | ConnectionEvent::ListenUpgradeError(_) | ConnectionEvent::AddressChange(_) + | ConnectionEvent::LocalProtocolsChange(_) + | ConnectionEvent::RemoteProtocolsChange(_) | ConnectionEvent::DialUpgradeError(_) => false, } }