From a87c7e5c08b027d104bfa00c6f7858398c2d63a6 Mon Sep 17 00:00:00 2001 From: Modupe Falodun Date: Sun, 31 Oct 2021 17:59:53 +0100 Subject: [PATCH] rust: remove unnecessary nested match Bug: #4605 --- rust/src/dhcp/logger.rs | 12 ++---------- rust/src/lib.rs | 1 - 2 files changed, 2 insertions(+), 11 deletions(-) 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; -- 2.47.2