mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-06 09:46:58 +00:00
push: code style cleanup
no semantic changes intended Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
parent
162ff15378
commit
89ef8bf502
@ -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)
|
||||
},
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user