From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 657CF1FF0E3 for ; Tue, 21 Jul 2026 15:54:43 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 3910721540; Tue, 21 Jul 2026 15:54:13 +0200 (CEST) From: Arthur Bied-Charreton To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-firewall 09/13] firewall: fix clippy warnings Date: Tue, 21 Jul 2026 15:54:03 +0200 Message-ID: <20260721135407.372150-10-a.bied-charreton@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260721135407.372150-1-a.bied-charreton@proxmox.com> References: <20260721135407.372150-1-a.bied-charreton@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 2 DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 1.274 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 Message-ID-Hash: LPC3KTD744XO44L2WCHAJPYCAOYX3HH6 X-Message-ID-Hash: LPC3KTD744XO44L2WCHAJPYCAOYX3HH6 X-MailFrom: abied-charreton@jett.proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: No functional changes intended. Signed-off-by: Arthur Bied-Charreton --- proxmox-firewall/src/firewall.rs | 4 ++-- proxmox-firewall/src/rule.rs | 38 ++++++++++++++++---------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/proxmox-firewall/src/firewall.rs b/proxmox-firewall/src/firewall.rs index f105fa8..477b69b 100644 --- a/proxmox-firewall/src/firewall.rs +++ b/proxmox-firewall/src/firewall.rs @@ -251,8 +251,8 @@ impl Firewall { if let Some(ipam_config) = self.config.ipam() { let ipsets = ipam_config.ipsets(); - self.create_ipsets(&mut commands, &ipsets, &cluster_host_table, None)?; - self.create_ipsets(&mut commands, &ipsets, &guest_table, None)?; + self.create_ipsets(&mut commands, ipsets, &cluster_host_table, None)?; + self.create_ipsets(&mut commands, ipsets, &guest_table, None)?; } if self.config.host().is_enabled() { diff --git a/proxmox-firewall/src/rule.rs b/proxmox-firewall/src/rule.rs index 048c00e..d33e31a 100644 --- a/proxmox-firewall/src/rule.rs +++ b/proxmox-firewall/src/rule.rs @@ -250,24 +250,24 @@ impl ToNftRules for RuleMatch { return Ok(()); } - if let Some(log) = self.log() { - if let Ok(log_level) = LogLevel::try_from(log) { - let mut terminal_statements = Vec::new(); + if let Some(log) = self.log() + && let Ok(log_level) = LogLevel::try_from(log) + { + let mut terminal_statements = Vec::new(); - if let Some(limit) = env.default_log_limit() { - terminal_statements.push(Statement::from(limit)); - } + if let Some(limit) = env.default_log_limit() { + terminal_statements.push(Statement::from(limit)); + } - terminal_statements.push( - Log::new_nflog( - Log::generate_prefix(env.vmid, log_level, env.chain.name(), self.verdict()), - 0, - ) - .into(), - ); + terminal_statements.push( + Log::new_nflog( + Log::generate_prefix(env.vmid, log_level, env.chain.name(), self.verdict()), + 0, + ) + .into(), + ); - rules.push(NftRule::from_terminal_statements(terminal_statements)); - } + rules.push(NftRule::from_terminal_statements(terminal_statements)); } rules.push(NftRule::new(generate_verdict(self.verdict(), env))); @@ -844,10 +844,10 @@ impl ToNftRules for Ipfilter<'_> { impl ToNftRules for CtHelperMacro { fn to_nft_rules(&self, rules: &mut Vec, env: &NftRuleEnv) -> Result<(), Error> { - if let Some(family) = self.family() { - if !env.contains_family(family) { - return Ok(()); - } + if let Some(family) = self.family() + && !env.contains_family(family) + { + return Ok(()); } if self.tcp().is_none() && self.udp().is_none() { -- 2.47.3