Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit f064389

Browse files
committed
chore: clippy
1 parent 1807d13 commit f064389

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

src/p2p/swarm.rs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,8 @@ mod tests {
455455
Swarm::listen_on(&mut swarm1, "/ip4/127.0.0.1/tcp/0".parse().unwrap()).unwrap();
456456

457457
loop {
458-
match swarm1.next_event().await {
459-
SwarmEvent::NewListenAddr(_) => {
460-
break;
461-
}
462-
_ => {}
458+
if let SwarmEvent::NewListenAddr(_) = swarm1.next_event().await {
459+
break;
463460
}
464461
}
465462

@@ -522,13 +519,10 @@ mod tests {
522519
let address;
523520

524521
loop {
525-
match swarm1.next_event().await {
526-
SwarmEvent::NewListenAddr(addr) => {
527-
// wonder if there should be a timeout?
528-
address = addr;
529-
break;
530-
}
531-
_ => {}
522+
if let SwarmEvent::NewListenAddr(addr) = swarm1.next_event().await {
523+
// wonder if there should be a timeout?
524+
address = addr;
525+
break;
532526
}
533527
}
534528

@@ -572,9 +566,8 @@ mod tests {
572566
let mut addresses = Vec::with_capacity(2);
573567

574568
while addresses.len() < 2 {
575-
match swarm1.next_event().await {
576-
SwarmEvent::NewListenAddr(addr) => addresses.push(addr),
577-
_ => {}
569+
if let SwarmEvent::NewListenAddr(addr) = swarm1.next_event().await {
570+
addresses.push(addr);
578571
}
579572
}
580573

0 commit comments

Comments
 (0)