Skip to content

Commit

Permalink
Fix clippy(nightly) warning: replace redundant map_or with `is_some…
Browse files Browse the repository at this point in the history
…_and`
  • Loading branch information
pc-anssi committed Nov 26, 2024
1 parent f81606b commit 378fa27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pcap-rewrite/src/filters/dispatch_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ impl DispatchFilterBuilder {
FilteringAction::Keep => Box::new(|c, ipaddr_proto_port_option| {
Ok(ipaddr_proto_port_option
.as_ref()
.map_or(false, |ipaddr_proto_port| c.contains(ipaddr_proto_port)))
.is_some_and(|ipaddr_proto_port| c.contains(ipaddr_proto_port)))
}),
FilteringAction::Drop => Box::new(|c, ipaddr_proto_port_option| {
Ok(ipaddr_proto_port_option
.as_ref()
.map_or(false, |ipaddr_proto_port| !c.contains(ipaddr_proto_port)))
.is_some_and(|ipaddr_proto_port| !c.contains(ipaddr_proto_port)))
}),
};

Expand All @@ -209,12 +209,12 @@ impl DispatchFilterBuilder {
FilteringAction::Keep => Box::new(|c, five_tuple_option| {
Ok(five_tuple_option
.as_ref()
.map_or(false, |five_tuple| c.contains(five_tuple)))
.is_some_and(|five_tuple| c.contains(five_tuple)))
}),
FilteringAction::Drop => Box::new(|c, five_tuple_option| {
Ok(five_tuple_option
.as_ref()
.map_or(false, |five_tuple| !c.contains(five_tuple)))
.is_some_and(|five_tuple| !c.contains(five_tuple)))
}),
};

Expand Down

0 comments on commit 378fa27

Please sign in to comment.