Skip to content

Commit 66821dc

Browse files
Use if let for single variant matching
1 parent ba58f24 commit 66821dc

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

swarm/src/connection.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -934,14 +934,11 @@ mod tests {
934934
Self::OutboundOpenInfo,
935935
>,
936936
) {
937-
match event {
938-
ConnectionEvent::ProtocolsChange(ProtocolsChange { protocols }) => {
939-
self.reported_protocols = protocols
940-
.iter()
941-
.map(|b| std::str::from_utf8(b).unwrap().to_owned())
942-
.collect();
943-
}
944-
_ => {}
937+
if let ConnectionEvent::ProtocolsChange(ProtocolsChange { protocols }) = event {
938+
self.reported_protocols = protocols
939+
.iter()
940+
.map(|b| std::str::from_utf8(b).unwrap().to_owned())
941+
.collect();
945942
}
946943
}
947944

0 commit comments

Comments
 (0)