]> git.proxmox.com Git - proxmox-backup.git/commitdiff
remove needless borrows
authorMaximiliano Sandoval <m.sandoval@proxmox.com>
Mon, 12 Feb 2024 13:17:28 +0000 (14:17 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 13 Feb 2024 09:06:16 +0000 (10:06 +0100)
Fixes the clippy lint:

```
warning: the borrowed expression implements the required traits
   --> src/server/report.rs:193:47
    |
193 |                         get_directory_content(&path)
    |                                               ^^^^^ help: change this to: `path`
    |
    = 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: Maximiliano Sandoval <m.sandoval@proxmox.com>
src/server/pull.rs
src/server/report.rs
src/tape/changer/online_status_map.rs
src/tools/disks/mod.rs

index 5f235b0aca01d1e63d4c5728ec0fcf3ddbd6cbd8..5a4ba8065750f6544a71f02e0728c0ec527fdca0 100644 (file)
@@ -199,7 +199,7 @@ impl PullSource for RemoteSource {
         });
 
         if !namespace.is_root() {
-            args["ns"] = serde_json::to_value(&namespace)?;
+            args["ns"] = serde_json::to_value(namespace)?;
         }
 
         self.client.login().await?;
@@ -230,7 +230,7 @@ impl PullSource for RemoteSource {
     }
 
     fn get_store(&self) -> &str {
-        &self.repo.store()
+        self.repo.store()
     }
 
     async fn reader(
index 6b033832cfe6f3a34b37e396e0252240a84985e3..d97efb14347e1715a26093ef7534bdc9947c0423 100644 (file)
@@ -190,7 +190,7 @@ pub fn generate_report() -> String {
                 .map(|file_name| {
                     let path = Path::new(file_name);
                     if path.is_dir() {
-                        get_directory_content(&path)
+                        get_directory_content(path)
                     } else {
                         get_file_content(file_name)
                     }
index c3da04154fb216658602cfd09dc91582c96acffc..d7f3ca7a703157c9a0a91d7b0460552a138440b4 100644 (file)
@@ -88,7 +88,7 @@ impl OnlineStatusMap {
 }
 
 fn insert_into_online_set(inventory: &Inventory, label_text: &str, online_set: &mut HashSet<Uuid>) {
-    match inventory.find_media_by_label_text(&label_text) {
+    match inventory.find_media_by_label_text(label_text) {
         Ok(Some(media_id)) => {
             online_set.insert(media_id.label.uuid.clone());
         }
index 7a772356881720a50e9527d548577ddda9dd69e4..78360b661b8105208e6fd25592be96af81cadf9b 100644 (file)
@@ -1167,7 +1167,7 @@ pub fn wipe_blockdev(disk: &Disk, worker: Arc<WorkerTask>) -> Result<(), Error>
 
     if is_partition {
         // set the partition type to 0x83 'Linux filesystem'
-        change_parttype(&disk, "8300", worker)?;
+        change_parttype(disk, "8300", worker)?;
     }
 
     Ok(())