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

@ -265,9 +265,9 @@ impl ScsiMediaChange for ScsiTapeChanger {
}
let status = if USE_MTX {
mtx::mtx_status(&self)
mtx::mtx_status(self)
} else {
sg_pt_changer::status(&self)
sg_pt_changer::status(self)
};
match &status {

View File

@ -21,7 +21,7 @@ pub fn mtx_status(config: &ScsiTapeChanger) -> Result<MtxStatus, Error> {
let mut status = parse_mtx_status(&output)?;
status.mark_import_export_slots(&config)?;
status.mark_import_export_slots(config)?;
Ok(status)
}

View File

@ -203,7 +203,7 @@ Data Transfer Element 1:Empty
Storage Element 24 IMPORT/EXPORT:Empty
"###;
let _ = parse_mtx_status(&output)?;
let _ = parse_mtx_status(output)?;
Ok(())
}

View File

@ -192,11 +192,11 @@ pub fn update_changer_online_status(
let mut online_map = OnlineStatusMap::new(drive_config)?;
let mut online_set = HashSet::new();
for label_text in label_text_list.iter() {
if let Some(media_id) = inventory.find_media_by_label_text(&label_text) {
if let Some(media_id) = inventory.find_media_by_label_text(label_text) {
online_set.insert(media_id.label.uuid.clone());
}
}
online_map.update_online_status(&changer_name, online_set)?;
online_map.update_online_status(changer_name, online_set)?;
inventory.update_online_status(&online_map)?;
Ok(())