From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <mira@nena.proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 30846936D3
 for <pmg-devel@lists.proxmox.com>; Tue, 20 Feb 2024 11:07:52 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 0CC264275
 for <pmg-devel@lists.proxmox.com>; Tue, 20 Feb 2024 11:07:22 +0100 (CET)
Received: from nena.proxmox.com (unknown [94.136.29.99])
 by firstgate.proxmox.com (Proxmox) with ESMTP
 for <pmg-devel@lists.proxmox.com>; Tue, 20 Feb 2024 11:07:18 +0100 (CET)
Received: by nena.proxmox.com (Postfix, from userid 1000)
 id 3481ECC689; Tue, 20 Feb 2024 11:07:18 +0100 (CET)
From: Mira Limbeck <m.limbeck@proxmox.com>
To: pmg-devel@lists.proxmox.com
Date: Tue, 20 Feb 2024 11:06:48 +0100
Message-Id: <20240220100648.44119-5-m.limbeck@proxmox.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20240220100648.44119-1-m.limbeck@proxmox.com>
References: <20240220100648.44119-1-m.limbeck@proxmox.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.618 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery
 methods
 RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_NONE                0.001 SPF: sender does not publish an SPF Record
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: [pmg-devel] [PATCH v3 pmg-log-tracker 5/5] cleanup: fix clippy
 warnings
X-BeenThere: pmg-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Mail Gateway development discussion
 <pmg-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pmg-devel>, 
 <mailto:pmg-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pmg-devel/>
List-Post: <mailto:pmg-devel@lists.proxmox.com>
List-Help: <mailto:pmg-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel>, 
 <mailto:pmg-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Tue, 20 Feb 2024 10:07:52 -0000

Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
---
v3:
 - added `pmg-log-tracker` to subject

 src/main.rs | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index 5d4f86e..0a4f192 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -748,8 +748,9 @@ impl Default for ToEntry {
     }
 }
 
-#[derive(Debug, PartialEq, Copy, Clone)]
+#[derive(Debug, PartialEq, Copy, Clone, Default)]
 enum DStatus {
+    #[default]
     Invalid,
     Accept,
     Quarantine,
@@ -762,12 +763,6 @@ enum DStatus {
     Dsn(u32),
 }
 
-impl Default for DStatus {
-    fn default() -> Self {
-        DStatus::Invalid
-    }
-}
-
 impl std::fmt::Display for DStatus {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         let c = match self {
@@ -1314,6 +1309,7 @@ impl QEntry {
         true
     }
 
+    #[allow(clippy::wrong_self_convention)]
     fn from_to_matches(&mut self, parser: &Parser) -> bool {
         if !parser.options.from.is_empty() {
             if self.from.is_empty() {
@@ -2368,7 +2364,7 @@ fn parse_host_service_pid(data: &[u8]) -> Option<(ByteSlice, ByteSlice, u64, Byt
         .count();
     let service = &data[0..service_count];
     let data = &data[service_count..];
-    if data.get(0) != Some(&b'[') {
+    if data.first() != Some(&b'[') {
         return None;
     }
     let data = &data[1..];
-- 
2.39.2