5
0
mirror of git://git.proxmox.com/git/proxmox-backup.git synced 2025-01-24 02:04:14 +03:00

config: clippy fixes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2022-07-27 15:22:09 +02:00
parent 64dc5dbf08
commit 4597eedf13
14 changed files with 18 additions and 18 deletions

View File

@ -59,7 +59,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
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(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}

View File

@ -56,7 +56,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
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(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}
@ -73,6 +73,6 @@ pub fn complete_openid_realm_name(_arg: &str, _param: &HashMap<String, String>)
}
})
.collect(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}

View File

@ -101,7 +101,7 @@ pub fn check_drive_exists(config: &SectionConfigData, drive: &str) -> Result<(),
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(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}
@ -114,7 +114,7 @@ pub fn complete_lto_drive_name(_arg: &str, _param: &HashMap<String, String>) ->
.filter(|(_id, (section_type, _))| section_type == "lto")
.map(|(id, _)| id.to_string())
.collect(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}
@ -127,6 +127,6 @@ pub fn complete_changer_name(_arg: &str, _param: &HashMap<String, String>) -> Ve
.filter(|(_id, (section_type, _))| section_type == "changer")
.map(|(id, _)| id.to_string())
.collect(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}

View File

@ -68,6 +68,6 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
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(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}

View File

@ -65,7 +65,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
pub fn complete_remote_name(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.sections.keys().cloned().collect(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}

View File

@ -4,7 +4,7 @@ use std::iter::Iterator;
use lazy_static::lazy_static;
#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum Token {
Text,
Comment,

View File

@ -501,7 +501,7 @@ pub fn save_config(config: &NetworkConfig) -> Result<(), Error> {
pub fn complete_interface_name(_arg: &str, _param: &HashMap<String, String>) -> Vec<String> {
match config() {
Ok((data, _digest)) => data.interfaces.keys().map(|id| id.to_string()).collect(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}
@ -515,7 +515,7 @@ pub fn complete_port_list(arg: &str, _param: &HashMap<String, String>) -> Vec<St
}
}
}
Err(_) => return vec![],
Err(_) => return Vec::new(),
};
let arg = arg.trim();

View File

@ -52,6 +52,6 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
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(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}

View File

@ -54,6 +54,6 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
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(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}

View File

@ -53,6 +53,6 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
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(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}

View File

@ -55,6 +55,6 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
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(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}

View File

@ -68,7 +68,7 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
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(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}

View File

@ -157,7 +157,7 @@ pub fn complete_userid(_arg: &str, _param: &HashMap<String, String>) -> Vec<Stri
}
})
.collect(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}

View File

@ -57,6 +57,6 @@ pub fn save_config(config: &SectionConfigData) -> Result<(), Error> {
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(),
Err(_) => return vec![],
Err(_) => Vec::new(),
}
}