diff --git a/src/behaviour.rs b/src/behaviour.rs index aae4beb5811..9ffbaefdfa9 100644 --- a/src/behaviour.rs +++ b/src/behaviour.rs @@ -38,7 +38,7 @@ use libp2p_swarm::{ ExpiredListenAddr, FromSwarm, }, ConnectionId, ExternalAddresses, ListenAddresses, NetworkBehaviour, NetworkBehaviourAction, - PollParameters, THandlerOutEvent, + PollParameters, THandlerInEvent, THandlerOutEvent, }; use std::{ collections::{HashMap, VecDeque}, @@ -208,10 +208,7 @@ pub struct Behaviour { last_probe: Option, pending_actions: VecDeque< - NetworkBehaviourAction< - ::OutEvent, - ::ConnectionHandler, - >, + NetworkBehaviourAction<::OutEvent, THandlerInEvent>, >, probe_id: ProbeId, @@ -389,14 +386,14 @@ impl Behaviour { &mut self, DialFailure { peer_id, - handler, + connection_id, error, - }: DialFailure<::ConnectionHandler>, + }: DialFailure, ) { self.inner .on_swarm_event(FromSwarm::DialFailure(DialFailure { peer_id, - handler, + connection_id, error, })); if let Some(event) = self.as_server().on_outbound_dial_error(peer_id, error) { @@ -560,10 +557,8 @@ impl NetworkBehaviour for Behaviour { } } -type Action = NetworkBehaviourAction< - ::OutEvent, - ::ConnectionHandler, ->; +type Action = + NetworkBehaviourAction<::OutEvent, THandlerInEvent>; // Trait implemented for `AsClient` and `AsServer` to handle events from the inner [`request_response::Behaviour`] Protocol. trait HandleInnerEvent { diff --git a/src/behaviour/as_server.rs b/src/behaviour/as_server.rs index 7a8c9f9c4b8..ec38678e4f5 100644 --- a/src/behaviour/as_server.rs +++ b/src/behaviour/as_server.rs @@ -29,7 +29,7 @@ use libp2p_request_response::{ }; use libp2p_swarm::{ dial_opts::{DialOpts, PeerCondition}, - ConnectionId, DialError, NetworkBehaviour, NetworkBehaviourAction, PollParameters, + ConnectionId, DialError, NetworkBehaviourAction, PollParameters, }; use std::{ collections::{HashMap, HashSet, VecDeque}, @@ -138,7 +138,6 @@ impl<'a> HandleInnerEvent for AsServer<'a> { ) .addresses(addrs) .build(), - handler: self.inner.new_handler(), }, ]) }