tree-wide: fix needless borrows

found and fixed via clippy

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler
2021-12-30 12:57:37 +01:00
parent a0c69902c8
commit 9a37bd6c84
104 changed files with 238 additions and 241 deletions

View File

@ -62,14 +62,14 @@ fn get_tape_handle(param: &Value) -> Result<SgTape, Error> {
if let Some(name) = param["drive"].as_str() {
let (config, _digest) = pbs_config::drive::config()?;
let drive: LtoTapeDrive = config.lookup("lto", &name)?;
let drive: LtoTapeDrive = config.lookup("lto", name)?;
eprintln!("using device {}", drive.path);
return SgTape::new(open_lto_tape_device(&drive.path)?);
}
if let Some(device) = param["device"].as_str() {
eprintln!("using device {}", device);
return SgTape::new(open_lto_tape_device(&device)?);
return SgTape::new(open_lto_tape_device(device)?);
}
if let Ok(name) = std::env::var("PROXMOX_TAPE_DRIVE") {
@ -94,7 +94,7 @@ fn get_tape_handle(param: &Value) -> Result<SgTape, Error> {
if drive_names.len() == 1 {
let name = drive_names[0];
let drive: LtoTapeDrive = config.lookup("lto", &name)?;
let drive: LtoTapeDrive = config.lookup("lto", name)?;
eprintln!("using device {}", drive.path);
return SgTape::new(open_lto_tape_device(&drive.path)?);
}

View File

@ -36,7 +36,7 @@ fn get_changer_handle(param: &Value) -> Result<File, Error> {
if let Some(name) = param["changer"].as_str() {
let (config, _digest) = pbs_config::drive::config()?;
let changer_config: ScsiTapeChanger = config.lookup("changer", &name)?;
let changer_config: ScsiTapeChanger = config.lookup("changer", name)?;
eprintln!("using device {}", changer_config.path);
return sg_pt_changer::open(&changer_config.path);
}