]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: remove unnecessary nested match 6552/head
authorModupe Falodun <falodunmodupeola@gmail.com>
Sun, 31 Oct 2021 16:59:53 +0000 (17:59 +0100)
committerVictor Julien <victor@inliniac.net>
Sun, 31 Oct 2021 19:29:56 +0000 (20:29 +0100)
Bug: #4605

rust/src/dhcp/logger.rs
rust/src/lib.rs

index bed75ecdfdc5aaab485b8078374fe5fe64be8c54..6fe835ebd3717ebe61be9ea8688985596338ae51 100644 (file)
@@ -59,16 +59,8 @@ impl DHCPLogger {
 
     pub fn do_log(&self, tx: &DHCPTransaction) -> bool {
         if !self.extended {
-            match self.get_type(tx) {
-                Some(t) => {
-                    match t {
-                        DHCP_TYPE_ACK => {
-                            return true;
-                        }
-                        _ => {}
-                    }
-                }
-                _ => {}
+            if let Some(DHCP_TYPE_ACK) = self.get_type(tx){
+                return true;
             }
             return false;
         }
index e182074ab733b7107123b2456b38977bcf4a7552..2e5d6d45b1a36de064214a3d45d3119e8b38b81f 100644 (file)
@@ -63,7 +63,6 @@
 #![allow(clippy::while_let_loop)]
 #![allow(clippy::redundant_pattern_matching)]
 #![allow(clippy::field_reassign_with_default)]
-#![allow(clippy::collapsible_match)]
 
 #[macro_use]
 extern crate nom;