clippy: remove unnecessary clones
and from::<T>(T) Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
@ -577,7 +577,7 @@ pub fn complete_port_list(arg: &str, _param: &HashMap<String, String>) -> Vec<St
|
||||
Err(_) => return vec![],
|
||||
};
|
||||
|
||||
let arg = arg.clone().trim();
|
||||
let arg = arg.trim();
|
||||
let prefix = if let Some(idx) = arg.rfind(",") { &arg[..idx+1] } else { "" };
|
||||
ports.iter().map(|port| format!("{}{}", prefix, port)).collect()
|
||||
}
|
||||
|
@ -79,7 +79,7 @@ impl From<&SyncJobStatus> for SyncJobConfig {
|
||||
owner: job_status.owner.clone(),
|
||||
remote: job_status.remote.clone(),
|
||||
remote_store: job_status.remote_store.clone(),
|
||||
remove_vanished: job_status.remove_vanished.clone(),
|
||||
remove_vanished: job_status.remove_vanished,
|
||||
comment: job_status.comment.clone(),
|
||||
schedule: job_status.schedule.clone(),
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ pub struct EncryptionKeyConfig {
|
||||
}
|
||||
|
||||
pub fn compute_tape_key_fingerprint(key: &[u8; 32]) -> Result<Fingerprint, Error> {
|
||||
let crypt_config = CryptConfig::new(key.clone())?;
|
||||
let crypt_config = CryptConfig::new(*key)?;
|
||||
Ok(crypt_config.fingerprint())
|
||||
}
|
||||
|
||||
@ -228,7 +228,7 @@ pub fn insert_key(key: [u8;32], key_config: KeyConfig, hint: String) -> Result<(
|
||||
save_keys(key_map)?;
|
||||
|
||||
let item = EncryptionKeyConfig::new(key_config, hint);
|
||||
config_map.insert(fingerprint.clone(), item);
|
||||
config_map.insert(fingerprint, item);
|
||||
save_key_configs(config_map)?;
|
||||
|
||||
Ok(())
|
||||
|
Reference in New Issue
Block a user