all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager 2/3] api: resources: fix 'irrefutable let pattern' clippy warning
Date: Thu, 16 Oct 2025 13:35:47 +0200	[thread overview]
Message-ID: <20251016113548.213211-3-l.wagner@proxmox.com> (raw)
In-Reply-To: <20251016113548.213211-1-l.wagner@proxmox.com>

We could just drop the 'let PveSdnResouce::Zone(_) = &r' line completely
without changing behavior, but I've kept it in because it leads to a
compiler error once a new enum variant is introduced, forcing the
developer to handle the new variant there.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 server/src/api/resources.rs | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/server/src/api/resources.rs b/server/src/api/resources.rs
index f4f56bcf..6bff7352 100644
--- a/server/src/api/resources.rs
+++ b/server/src/api/resources.rs
@@ -369,17 +369,17 @@ pub async fn get_status(
                     _ => counts.pve_nodes.unknown += 1,
                 },
                 Resource::PveSdn(r) => {
-                    if let PveSdnResource::Zone(_) = &r {
-                        match r.status() {
-                            SdnStatus::Available => {
-                                counts.sdn_zones.available += 1;
-                            }
-                            SdnStatus::Error => {
-                                counts.sdn_zones.error += 1;
-                            }
-                            SdnStatus::Unknown => {
-                                counts.sdn_zones.unknown += 1;
-                            }
+                    let PveSdnResource::Zone(_) = &r;
+
+                    match r.status() {
+                        SdnStatus::Available => {
+                            counts.sdn_zones.available += 1;
+                        }
+                        SdnStatus::Error => {
+                            counts.sdn_zones.error += 1;
+                        }
+                        SdnStatus::Unknown => {
+                            counts.sdn_zones.unknown += 1;
                         }
                     }
                 }
-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  parent reply	other threads:[~2025-10-16 11:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16 11:35 [pdm-devel] [PATCH datacenter-manager 0/3] clippy fixes Lukas Wagner
2025-10-16 11:35 ` [pdm-devel] [PATCH datacenter-manager 1/3] task cache: " Lukas Wagner
2025-10-16 11:35 ` Lukas Wagner [this message]
2025-10-16 11:35 ` [pdm-devel] [PATCH datacenter-manager 3/3] pbs-client: fix 'useless use of `format!`' clippy warning Lukas Wagner
2025-10-16 22:48 ` [pdm-devel] applied: [PATCH datacenter-manager 0/3] clippy fixes Thomas Lamprecht

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=20251016113548.213211-3-l.wagner@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=pdm-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal