Skip to content

Commit

Permalink
chore: fix a few clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Feb 1, 2024
1 parent 939e6de commit 3258f9f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/anemo/src/network/connection_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,11 @@ impl ConnectionManager {
// TODO close the connection explicitly with a reason once we have machine
// readable errors. See https://github.com/MystenLabs/anemo/issues/13 for more info.
match known_peers.get(&connection.peer_id()) {
Some(PeerInfo { affinity, .. })
if matches!(affinity, PeerAffinity::High | PeerAffinity::Allowed) =>
Some(PeerInfo { affinity: PeerAffinity::High | PeerAffinity::Allowed, .. }) =>
{
// Do nothing, let the connection through
}
Some(PeerInfo { affinity, .. }) if matches!(affinity, PeerAffinity::Never) => {
Some(PeerInfo { affinity: PeerAffinity::Never, .. }) => {
return Err(anyhow::anyhow!(
"rejecting connection from peer {} due to having PeerAffinity::Never",
connection.peer_id()
Expand Down

0 comments on commit 3258f9f

Please sign in to comment.