all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH offline-mirror 1/2] remove needless borrows
@ 2024-02-14  9:27 Maximiliano Sandoval
  2024-02-14  9:27 ` [pbs-devel] [PATCH offline-mirror 2/2] verifier: elide explicit lifetime Maximiliano Sandoval
  2024-02-21 11:14 ` [pbs-devel] applied-series: [PATCH offline-mirror 1/2] remove needless borrows Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Maximiliano Sandoval @ 2024-02-14  9:27 UTC (permalink / raw)
  To: pbs-devel

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 | 2 +-
 src/pool.rs   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/medium.rs b/src/medium.rs
index 4b1f006..53df50d 100644
--- a/src/medium.rs
+++ b/src/medium.rs
@@ -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,
diff --git a/src/pool.rs b/src/pool.rs
index 3da8c08..f20f5ea 100644
--- a/src/pool.rs
+++ b/src/pool.rs
@@ -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(),
-- 
2.39.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-21 11:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-14  9:27 [pbs-devel] [PATCH offline-mirror 1/2] remove needless borrows Maximiliano Sandoval
2024-02-14  9:27 ` [pbs-devel] [PATCH offline-mirror 2/2] verifier: elide explicit lifetime Maximiliano Sandoval
2024-02-21 11:14 ` [pbs-devel] applied-series: [PATCH offline-mirror 1/2] remove needless borrows Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal