Skip to content

Commit 021502c

Browse files
committed
examples: update file-sharing example to libp2p-swarm
ListenUpgradeError and DialUpgradeError updates.
1 parent 4a0e5ee commit 021502c

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

examples/file-sharing.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ mod network {
216216
use libp2p::kad::{GetProvidersOk, Kademlia, KademliaEvent, QueryId, QueryResult};
217217
use libp2p::multiaddr::Protocol;
218218
use libp2p::request_response::{self, ProtocolSupport, RequestId, ResponseChannel};
219-
use libp2p::swarm::{ConnectionHandlerUpgrErr, NetworkBehaviour, Swarm, SwarmEvent};
219+
use libp2p::swarm::{NetworkBehaviour, Swarm, SwarmEvent};
220+
use libp2p_core::UpgradeError;
220221
use std::collections::{hash_map, HashMap, HashSet};
221222
use std::iter;
222223

@@ -403,10 +404,7 @@ mod network {
403404

404405
async fn handle_event(
405406
&mut self,
406-
event: SwarmEvent<
407-
ComposedEvent,
408-
EitherError<ConnectionHandlerUpgrErr<io::Error>, io::Error>,
409-
>,
407+
event: SwarmEvent<ComposedEvent, EitherError<UpgradeError<io::Error>, io::Error>>,
410408
) {
411409
match event {
412410
SwarmEvent::Behaviour(ComposedEvent::Kademlia(

0 commit comments

Comments
 (0)