mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-13 18:11:22 +00:00
chore: address latest clippy lints
I ran clippy on the current nightly and fixed issues found by it. Noteworthy are two instances of the [never_loop](https://rust-lang.github.io/rust-clippy/master/index.html#/never_loop) lint. Pull-Request: #4571.
This commit is contained in:
@ -428,14 +428,12 @@ async fn connect(
|
||||
let start = Instant::now();
|
||||
swarm.dial(server_address.clone()).unwrap();
|
||||
|
||||
let server_peer_id = loop {
|
||||
match swarm.next().await.unwrap() {
|
||||
SwarmEvent::ConnectionEstablished { peer_id, .. } => break peer_id,
|
||||
SwarmEvent::OutgoingConnectionError { peer_id, error, .. } => {
|
||||
bail!("Outgoing connection error to {:?}: {:?}", peer_id, error);
|
||||
}
|
||||
e => panic!("{e:?}"),
|
||||
let server_peer_id = match swarm.next().await.unwrap() {
|
||||
SwarmEvent::ConnectionEstablished { peer_id, .. } => peer_id,
|
||||
SwarmEvent::OutgoingConnectionError { peer_id, error, .. } => {
|
||||
bail!("Outgoing connection error to {:?}: {:?}", peer_id, error);
|
||||
}
|
||||
e => panic!("{e:?}"),
|
||||
};
|
||||
|
||||
let duration = start.elapsed();
|
||||
|
Reference in New Issue
Block a user