From: Modupe Falodun Date: Sun, 31 Oct 2021 16:59:53 +0000 (+0100) Subject: rust: remove unnecessary nested match X-Git-Tag: suricata-7.0.0-beta1~1274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6552%2Fhead;p=thirdparty%2Fsuricata.git rust: remove unnecessary nested match Bug: #4605 --- diff --git a/rust/src/dhcp/logger.rs b/rust/src/dhcp/logger.rs index bed75ecdfd..6fe835ebd3 100644 --- a/rust/src/dhcp/logger.rs +++ b/rust/src/dhcp/logger.rs @@ -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; } diff --git a/rust/src/lib.rs b/rust/src/lib.rs index e182074ab7..2e5d6d45b1 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -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;