[pve-devel] [PATCH installer v2 02/17] fetch-answer: partition: fix clippy warning

Christoph Heiss c.heiss at proxmox.com
Thu Jul 18 15:48:47 CEST 2024


warning: the borrowed expression implements the required traits
  --> proxmox-fetch-answer/src/fetch_plugins/partition.rs:34:44
   |
34 |     let path = Path::new(search_path).join(&file_name);
   |                                            ^^^^^^^^^^ help: change this to: `file_name`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args
   = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default

Signed-off-by: Christoph Heiss <c.heiss at proxmox.com>
---
Changes v1 -> v2:
  * new patch, split out from unrelated patch
---
 proxmox-fetch-answer/src/fetch_plugins/partition.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxmox-fetch-answer/src/fetch_plugins/partition.rs b/proxmox-fetch-answer/src/fetch_plugins/partition.rs
index 4472922..f07389b 100644
--- a/proxmox-fetch-answer/src/fetch_plugins/partition.rs
+++ b/proxmox-fetch-answer/src/fetch_plugins/partition.rs
@@ -31,7 +31,7 @@ impl FetchFromPartition {
 }
 
 fn path_exists_logged(file_name: &str, search_path: &str) -> Option<PathBuf> {
-    let path = Path::new(search_path).join(&file_name);
+    let path = Path::new(search_path).join(file_name);
     info!("Testing partition search path {path:?}");
     match path.try_exists() {
         Ok(true) => Some(path),
-- 
2.45.1





More information about the pve-devel mailing list