5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2024-12-22 13:34:16 +03:00

pbs-config: clippy fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2023-05-17 16:40:41 +02:00
parent b6e7fc9bec
commit 82c0194efd
12 changed files with 13 additions and 13 deletions

View File

@ -796,8 +796,8 @@ mod test {
let path_vec = super::split_acl_path(path);
let mut roles = tree
.roles(auth_id, &path_vec)
.iter()
.map(|(v, _)| v.clone())
.keys()
.cloned()
.collect::<Vec<String>>();
roles.sort();
let roles = roles.join(",");

View File

@ -58,7 +58,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
// shell completion helper
pub fn complete_datastore_name(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.sections.iter().map(|(id, _)| id.to_string()).collect(),
Ok((data, _digest)) => data.sections.keys().map(|id| id.to_string()).collect(),
Err(_) => Vec::new(),
}
}

View File

@ -66,7 +66,7 @@ pub fn exists(domains: &SectionConfigData, realm: &str) -> bool {
// shell completion helper
pub fn complete_realm_name(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.sections.iter().map(|(id, _)| id.to_string()).collect(),
Ok((data, _digest)) => data.sections.keys().map(|id| id.to_string()).collect(),
Err(_) => Vec::new(),
}
}

View File

@ -100,7 +100,7 @@ pub fn check_drive_exists(config: &SectionConfigData, drive: &str) -> Result<(),
/// List all drive names
pub fn complete_drive_name(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.sections.iter().map(|(id, _)| id.to_string()).collect(),
Ok((data, _digest)) => data.sections.keys().map(|id| id.to_string()).collect(),
Err(_) => Vec::new(),
}
}

View File

@ -67,7 +67,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
/// List existing pool names
pub fn complete_pool_name(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.sections.iter().map(|(id, _)| id.to_string()).collect(),
Ok((data, _digest)) => data.sections.keys().map(|id| id.to_string()).collect(),
Err(_) => Vec::new(),
}
}

View File

@ -51,7 +51,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
// shell completion helper
pub fn complete_prune_job_id(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.sections.iter().map(|(id, _)| id.to_string()).collect(),
Ok((data, _digest)) => data.sections.keys().map(|id| id.to_string()).collect(),
Err(_) => Vec::new(),
}
}

View File

@ -53,7 +53,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
// shell completion helper
pub fn complete_remote_name(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.sections.iter().map(|(id, _)| id.to_string()).collect(),
Ok((data, _digest)) => data.sections.keys().map(|id| id.to_string()).collect(),
Err(_) => Vec::new(),
}
}

View File

@ -52,7 +52,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
// shell completion helper
pub fn complete_sync_job_id(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.sections.iter().map(|(id, _)| id.to_string()).collect(),
Ok((data, _digest)) => data.sections.keys().map(|id| id.to_string()).collect(),
Err(_) => Vec::new(),
}
}

View File

@ -54,7 +54,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
/// List all tape job IDs
pub fn complete_tape_job_id(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.sections.iter().map(|(id, _)| id.to_string()).collect(),
Ok((data, _digest)) => data.sections.keys().map(|id| id.to_string()).collect(),
Err(_) => Vec::new(),
}
}

View File

@ -67,7 +67,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
// shell completion helper
pub fn complete_traffic_control_name(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.sections.iter().map(|(id, _)| id.to_string()).collect(),
Ok((data, _digest)) => data.sections.keys().map(|id| id.to_string()).collect(),
Err(_) => Vec::new(),
}
}

View File

@ -164,7 +164,7 @@ pub fn complete_userid(_arg: &str, _param: &HashMap<String, String>) -> Vec<Stri
// shell completion helper
pub fn complete_authid(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.sections.iter().map(|(id, _)| id.to_string()).collect(),
Ok((data, _digest)) => data.sections.keys().map(|id| id.to_string()).collect(),
Err(_) => vec![],
}
}

View File

@ -56,7 +56,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
// shell completion helper
pub fn complete_verification_job_id(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.sections.iter().map(|(id, _)| id.to_string()).collect(),
Ok((data, _digest)) => data.sections.keys().map(|id| id.to_string()).collect(),
Err(_) => Vec::new(),
}
}