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:
parent
64dc5dbf08
commit
4597eedf13
@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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();
|
||||
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ pub fn complete_userid(_arg: &str, _param: &HashMap<String, String>) -> Vec<Stri
|
||||
}
|
||||
})
|
||||
.collect(),
|
||||
Err(_) => return vec![],
|
||||
Err(_) => Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user