From: Jason Ish Date: Mon, 3 Oct 2022 22:17:07 +0000 (-0600) Subject: rust/modbus: derive default instead of manual impl X-Git-Tag: suricata-7.0.0-beta1~87 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45dfea24972e492f2ecdbe9c43c35627e02685e7;p=thirdparty%2Fsuricata.git rust/modbus: derive default instead of manual impl Cleans up a clippy lint for a trivial default impl that can be derived. --- diff --git a/rust/src/modbus/detect.rs b/rust/src/modbus/detect.rs index ab9888261a..93937b0bde 100644 --- a/rust/src/modbus/detect.rs +++ b/rust/src/modbus/detect.rs @@ -46,7 +46,7 @@ lazy_static! { .unwrap(); } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Default)] pub struct DetectModbusRust { category: Option>, function: Option, @@ -57,20 +57,6 @@ pub struct DetectModbusRust { value: Option>, } -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.