[pdm-devel] [PATCH datacenter-manager 2/3] api: resources: fix 'irrefutable let pattern' clippy warning
Lukas Wagner
l.wagner at proxmox.com
Thu Oct 16 13:35:47 CEST 2025
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 at 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
More information about the pdm-devel
mailing list