From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH offline-mirror 1/2] remove needless borrows
Date: Wed, 14 Feb 2024 10:27:29 +0100 [thread overview]
Message-ID: <20240214092730.168795-1-m.sandoval@proxmox.com> (raw)
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
next reply other threads:[~2024-02-14 9:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 9:27 Maximiliano Sandoval [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240214092730.168795-1-m.sandoval@proxmox.com \
--to=m.sandoval@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox