]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust/modbus: derive default instead of manual impl
authorJason Ish <jason.ish@oisf.net>
Mon, 3 Oct 2022 22:17:07 +0000 (16:17 -0600)
committerVictor Julien <vjulien@oisf.net>
Tue, 4 Oct 2022 09:22:02 +0000 (11:22 +0200)
Cleans up a clippy lint for a trivial default impl that can be derived.

rust/src/modbus/detect.rs

index ab9888261a67225e0e6d267920c244fb86d30a2d..93937b0bde1dde6e11bfce883e1227b1fc8ecf6f 100644 (file)
@@ -46,7 +46,7 @@ lazy_static! {
     .unwrap();
 }
 
-#[derive(Debug, PartialEq)]
+#[derive(Debug, PartialEq, Default)]
 pub struct DetectModbusRust {
     category: Option<Flags<CodeCategory>>,
     function: Option<FunctionCode>,
@@ -57,20 +57,6 @@ pub struct DetectModbusRust {
     value: Option<Range<u16>>,
 }
 
-impl Default for DetectModbusRust {
-    fn default() -> Self {
-        DetectModbusRust {
-            category: None,
-            function: None,
-            subfunction: None,
-            access_type: None,
-            unit_id: None,
-            address: None,
-            value: None,
-        }
-    }
-}
-
 /// Compares a range from the alert signature to the transaction's unit_id/address/value
 /// range. If the signature's range intersects with the transaction, it is a match and true is
 /// returned.