]> git.proxmox.com Git - proxmox-offline-mirror.git/commitdiff
remove needless borrows
authorMaximiliano Sandoval <m.sandoval@proxmox.com>
Wed, 14 Feb 2024 09:27:29 +0000 (10:27 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Feb 2024 11:13:30 +0000 (12:13 +0100)
Fixes the clippy lint
```
warning: the borrowed expression implements the required traits
   --> src/medium.rs:143:9
    |
143 |         &statefile(base),
    |         ^^^^^^^^^^^^^^^^ help: change this to: `statefile(base)`
    |
    = 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/medium.rs
src/pool.rs

index 4b1f006933b1ed3bf193aee2a0e2ba25807dcec6..53df50dc29a31818f3dd7b4e80f988506e4ba17d 100644 (file)
@@ -140,7 +140,7 @@ fn load_state(base: &Path) -> Result<Option<MediumState>, Error> {
 // Helper to write statefile
 fn write_state(_lock: &ConfigLockGuard, base: &Path, state: &MediumState) -> Result<(), Error> {
     replace_file(
-        &statefile(base),
+        statefile(base),
         &serde_json::to_vec(&state)?,
         CreateOptions::default(),
         true,
index 3da8c089533f03f34a9cd20cee73d793650bda23..f20f5eaf07578f44c1b56db2f21684cd916a65b7 100644 (file)
@@ -76,7 +76,7 @@ impl Pool {
     pub(crate) fn lock(&self) -> Result<PoolLockGuard, Error> {
         let timeout = std::time::Duration::new(30, 0);
         let lock = Some(proxmox_sys::fs::open_file_locked(
-            &self.lock_path(),
+            self.lock_path(),
             timeout,
             true,
             CreateOptions::default(),