From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 97251934A1 for ; Mon, 19 Feb 2024 18:56:32 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6E3F9340CF for ; Mon, 19 Feb 2024 18:56:02 +0100 (CET) Received: from nena.proxmox.com (unknown [94.136.29.99]) by firstgate.proxmox.com (Proxmox) with ESMTP for ; Mon, 19 Feb 2024 18:56:01 +0100 (CET) Received: by nena.proxmox.com (Postfix, from userid 1000) id D4974E769A; Mon, 19 Feb 2024 18:56:01 +0100 (CET) From: Mira Limbeck To: pmg-devel@lists.proxmox.com Date: Mon, 19 Feb 2024 18:55:47 +0100 Message-Id: <20240219175548.311288-5-m.limbeck@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240219175548.311288-1-m.limbeck@proxmox.com> References: <20240219175548.311288-1-m.limbeck@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.662 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 v2 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Feb 2024 17:56:32 -0000 Signed-off-by: Mira Limbeck --- src/main.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 82d5657..26dc720 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() { @@ -2371,7 +2367,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