[pbs-devel] [PATCH offline-mirror 1/2] remove needless borrows
Maximiliano Sandoval
m.sandoval at proxmox.com
Wed Feb 14 10:27:29 CET 2024
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 at 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
More information about the pbs-devel
mailing list