public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
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	[thread overview]
Message-ID: <20260721135407.372150-10-a.bied-charreton@proxmox.com> (raw)
In-Reply-To: <20260721135407.372150-1-a.bied-charreton@proxmox.com>

No functional changes intended.

Signed-off-by: Arthur Bied-Charreton <a.bied-charreton@proxmox.com>
---
 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<NftRule>, 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




  parent reply	other threads:[~2026-07-21 13:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 13:53 [RFC firewall/manager/proxmox{,-firewall} 00/13] fix #5759: keep firewall rules up across boot and shutdown Arthur Bied-Charreton
2026-07-21 13:53 ` [PATCH pve-manager 01/13] network interface pinning: write new firewall config to local dir Arthur Bied-Charreton
2026-07-21 13:53 ` [PATCH pve-firewall 02/13] firewall: config: sort OPTIONS when serializing Arthur Bied-Charreton
2026-07-21 13:53 ` [PATCH pve-firewall 03/13] d/control: bump libpve-common-perl Arthur Bied-Charreton
2026-07-21 13:53 ` [PATCH pve-firewall 04/13] firewall: dump configs locally after applying Arthur Bied-Charreton
2026-07-21 13:53 ` [PATCH pve-firewall 05/13] fix #5759: firewall: do not remove chains when host is shutting down Arthur Bied-Charreton
2026-07-21 13:54 ` [PATCH pve-firewall 06/13] firewall: add restore command Arthur Bied-Charreton
2026-07-21 13:54 ` [PATCH pve-firewall 07/13] fix #5759: firewall: restore from dumped config before network-pre Arthur Bied-Charreton
2026-07-21 13:54 ` [PATCH proxmox 08/13] systemd: systemctl: add is-system-running helper Arthur Bied-Charreton
2026-07-21 13:54 ` Arthur Bied-Charreton [this message]
2026-07-21 13:54 ` [PATCH proxmox-firewall 10/13] fix #5759: firewall: do not clear rules on system shutdown Arthur Bied-Charreton
2026-07-21 13:54 ` [PATCH proxmox-firewall 11/13] firewall: dump config to local directory after apply Arthur Bied-Charreton
2026-07-21 13:54 ` [PATCH proxmox-firewall 12/13] firewall: add restore command Arthur Bied-Charreton
2026-07-21 13:54 ` [PATCH proxmox-firewall 13/13] fix #5759: firewall: restore from dumped config before network-pre Arthur Bied-Charreton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260721135407.372150-10-a.bied-charreton@proxmox.com \
    --to=a.bied-charreton@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal