From: Jason Ish Date: Tue, 6 Aug 2024 16:30:13 +0000 (-0600) Subject: rust/dcerpc: clippy fix for match X-Git-Tag: suricata-7.0.7~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e93ae0a2227a4cfaf186a0a66f5026727f688a6;p=thirdparty%2Fsuricata.git rust/dcerpc: clippy fix for match error: this `match` can be collapsed into the outer `match` --> src/dcerpc/detect.rs:215:20 | 215 | Some(x) => match x { | ____________________^ 216 | | DCERPC_TYPE_REQUEST | DCERPC_TYPE_RESPONSE => {} 217 | | _ => { 218 | | return 0; 219 | | } 220 | | }, | |_________^ | help: the outer pattern can be modified to include the inner pattern --> src/dcerpc/detect.rs:215:14 | 215 | Some(x) => match x { | ^ replace this binding 216 | DCERPC_TYPE_REQUEST | DCERPC_TYPE_RESPONSE => {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with this pattern = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match --- diff --git a/rust/src/dcerpc/detect.rs b/rust/src/dcerpc/detect.rs index 81f2854ace..2a0209c80c 100644 --- a/rust/src/dcerpc/detect.rs +++ b/rust/src/dcerpc/detect.rs @@ -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; } };