Skip to content

Commit

Permalink
Fix clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ackintosh committed Jul 3, 2024
1 parent e35b8a1 commit 9bf2300
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/socket/filter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ impl Filter {
/// The first check. This determines if a new UDP packet should be decoded or dropped.
/// Only unsolicited packets arrive here.
pub fn initial_pass(&mut self, src: &SocketAddr) -> bool {
if PERMIT_BAN_LIST.read().permit_ips.get(&src.ip()).is_some() {
if PERMIT_BAN_LIST.read().permit_ips.contains(&src.ip()) {
return true;
}

if PERMIT_BAN_LIST.read().ban_ips.get(&src.ip()).is_some() {
if PERMIT_BAN_LIST.read().ban_ips.contains_key(&src.ip()) {
debug!("Dropped unsolicited packet from banned src: {:?}", src);
return false;
}
Expand Down Expand Up @@ -135,17 +135,15 @@ impl Filter {
if PERMIT_BAN_LIST
.read()
.permit_nodes
.get(&node_address.node_id)
.is_some()
.contains(&node_address.node_id)
{
return true;
}

if PERMIT_BAN_LIST
.read()
.ban_nodes
.get(&node_address.node_id)
.is_some()
.contains_key(&node_address.node_id)
{
debug!(
"Dropped unsolicited packet from banned node_id: {}",
Expand Down

0 comments on commit 9bf2300

Please sign in to comment.