]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: address clippy errors
authorVictor Julien <vjulien@oisf.net>
Sat, 27 Jul 2024 20:06:44 +0000 (22:06 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 29 Jul 2024 04:14:13 +0000 (06:14 +0200)
rust/src/conf.rs
rust/src/dcerpc/dcerpc.rs
rust/src/dcerpc/detect.rs

index 50acf6cae895852ad2cc9203542d734a0bb0221b..0d28f4d8b494b1e0c13a888c60f8894cc3fa5c68 100644 (file)
@@ -81,13 +81,8 @@ pub fn conf_get(key: &str) -> Option<&str> {
 // Return the value of key as a boolean. A value that is not set is
 // the same as having it set to false.
 pub fn conf_get_bool(key: &str) -> bool {
-    if let Some(val) = conf_get(key) {
-        match val {
-            "1" | "yes" | "true" | "on" => {
-                return true;
-            },
-            _ => {},
-        }
+    if let Some("1" | "yes" | "true" | "on") = conf_get(key) {
+        return true;
     }
 
     return false;
index bb82ad33be43565bfbb538b2771b55930a64c64a..9ac3b6ba2c44018233723791bc0efca6d3388e88 100644 (file)
@@ -504,7 +504,7 @@ impl DCERPCState {
     ///      description: call_id param derived from TCP Header
     /// * `dir`:
     ///         type: enum Direction
-    ///  description: direction of the flow
+    ///   description: direction of the flow
     ///
     /// Return value:
     /// Option mutable reference to DCERPCTransaction
index 81f2854ace6d79ab48cdf677025d9b38deb88218..b513bee2cf12289331a8446a44f0447158da3abe 100644 (file)
@@ -212,13 +212,8 @@ pub extern "C" fn rs_dcerpc_iface_match(
     }
 
     match state.get_hdr_type() {
-        Some(x) => match x {
-            DCERPC_TYPE_REQUEST | DCERPC_TYPE_RESPONSE => {}
-            _ => {
-                return 0;
-            }
-        },
-        None => {
+        Some(DCERPC_TYPE_REQUEST | DCERPC_TYPE_RESPONSE) => {},
+        _ => {
             return 0;
         }
     };