From 378fa27973e171fad108e193e2af48d43b0f5764 Mon Sep 17 00:00:00 2001 From: Pierre Chifflier Date: Tue, 26 Nov 2024 16:58:05 +0100 Subject: [PATCH] Fix clippy(nightly) warning: replace redundant `map_or` with `is_some_and` --- pcap-rewrite/src/filters/dispatch_filter.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pcap-rewrite/src/filters/dispatch_filter.rs b/pcap-rewrite/src/filters/dispatch_filter.rs index 79fd14a..3c4fc98 100644 --- a/pcap-rewrite/src/filters/dispatch_filter.rs +++ b/pcap-rewrite/src/filters/dispatch_filter.rs @@ -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))) }), }; @@ -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))) }), };