]> git.proxmox.com Git - proxmox-backup.git/commitdiff
push: code style cleanup
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Wed, 20 Nov 2024 15:42:11 +0000 (16:42 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 21 Nov 2024 10:01:25 +0000 (11:01 +0100)
no semantic changes intended

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
src/server/push.rs

index f712c6b31918d39e4ad8c9cba01164a2918bdd00..dc0fec5a5c91578ddb17857414550e06fa1fc30e 100644 (file)
@@ -233,16 +233,14 @@ async fn fetch_target_groups(
     let mut result = params.target.client.get(&api_path, args).await?;
     let groups: Vec<GroupListItem> = serde_json::from_value(result["data"].take())?;
 
-    let (mut owned, not_owned) = groups.iter().fold(
+    let (mut owned, not_owned) = groups.into_iter().fold(
         (Vec::new(), HashSet::new()),
         |(mut owned, mut not_owned), group| {
-            if let Some(ref owner) = group.owner {
-                if params.target.remote_user() == *owner {
-                    owned.push(group.backup.clone());
-                    return (owned, not_owned);
-                }
+            if Some(params.target.remote_user()) == group.owner {
+                owned.push(group.backup);
+            } else {
+                not_owned.insert(group.backup);
             }
-            not_owned.insert(group.backup.clone());
             (owned, not_owned)
         },
     );