[pdm-devel] [PATCH proxmox-datacenter-manager 6/7] api: resources: collapse identical if blocks

Maximiliano Sandoval m.sandoval at proxmox.com
Mon Dec 29 17:18:41 CET 2025


This was triggering the if_same_then_else clippy warning twice.

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 server/src/api/resources.rs | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/server/src/api/resources.rs b/server/src/api/resources.rs
index ecccb94a..654a4550 100644
--- a/server/src/api/resources.rs
+++ b/server/src/api/resources.rs
@@ -409,18 +409,17 @@ pub(crate) async fn get_resources_impl(
     for handle in join_handles {
         let remote_with_resources = handle.await?;
 
-        if filters.is_empty() {
-            remote_resources.push(remote_with_resources);
-        } else if !remote_with_resources.resources.is_empty() {
-            remote_resources.push(remote_with_resources);
-        } else if filters.matches(|filter| {
-            remote_matches_search_term(
-                &remote_with_resources.remote_name,
-                &remote_with_resources.remote,
-                Some(remote_with_resources.error.is_none()),
-                filter,
-            )
-        }) {
+        if filters.is_empty()
+            || !remote_with_resources.resources.is_empty()
+            || filters.matches(|filter| {
+                remote_matches_search_term(
+                    &remote_with_resources.remote_name,
+                    &remote_with_resources.remote,
+                    Some(remote_with_resources.error.is_none()),
+                    filter,
+                )
+            })
+        {
             remote_resources.push(remote_with_resources);
         }
     }
-- 
2.47.3





More information about the pdm-devel mailing list