From: Maximiliano Sandoval <m.sandoval@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH backup 03/13] remove needless borrows
Date: Mon, 12 Feb 2024 14:17:28 +0100 [thread overview]
Message-ID: <20240212131734.454966-3-m.sandoval@proxmox.com> (raw)
In-Reply-To: <20240212131734.454966-1-m.sandoval@proxmox.com>
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 | 4 ++--
src/server/report.rs | 2 +-
src/tape/changer/online_status_map.rs | 2 +-
src/tools/disks/mod.rs | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/server/pull.rs b/src/server/pull.rs
index 5f235b0a..5a4ba806 100644
--- a/src/server/pull.rs
+++ b/src/server/pull.rs
@@ -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(
diff --git a/src/server/report.rs b/src/server/report.rs
index 6b033832..d97efb14 100644
--- a/src/server/report.rs
+++ b/src/server/report.rs
@@ -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)
}
diff --git a/src/tape/changer/online_status_map.rs b/src/tape/changer/online_status_map.rs
index c3da0415..d7f3ca7a 100644
--- a/src/tape/changer/online_status_map.rs
+++ b/src/tape/changer/online_status_map.rs
@@ -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());
}
diff --git a/src/tools/disks/mod.rs b/src/tools/disks/mod.rs
index 7a772356..78360b66 100644
--- a/src/tools/disks/mod.rs
+++ b/src/tools/disks/mod.rs
@@ -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(())
--
2.39.2
next prev parent reply other threads:[~2024-02-12 13:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-12 13:17 [pbs-devel] [PATCH backup 01/13] docs: remove redundant explicit link target Maximiliano Sandoval
2024-02-12 13:17 ` [pbs-devel] [PATCH backup 02/13] remove redundant guards Maximiliano Sandoval
2024-02-12 13:17 ` Maximiliano Sandoval [this message]
2024-02-12 13:17 ` [pbs-devel] [PATCH backup 04/13] media_catalog: use stream_position Maximiliano Sandoval
2024-02-12 13:17 ` [pbs-devel] [PATCH backup 05/13] use or_default instead of or_insert_with(Default::default) Maximiliano Sandoval
2024-02-12 13:17 ` [pbs-devel] [PATCH backup 06/13] access first element with first() rather than get(0) Maximiliano Sandoval
2024-02-12 13:17 ` [pbs-devel] [PATCH backup 07/13] datastore: use is_{err, some} rather than match {Ok, Some}(_) Maximiliano Sandoval
2024-02-12 13:17 ` [pbs-devel] [PATCH backup 08/13] snapshot_reader: use Rc for structs that are not Send+Sync Maximiliano Sandoval
2024-02-13 9:20 ` Fabian Grünbichler
2024-02-12 13:17 ` [pbs-devel] [PATCH backup 09/13] pxar: elide explicit lifetime Maximiliano Sandoval
2024-02-13 9:04 ` [pbs-devel] [PATCH backup 01/13] docs: remove redundant explicit link target Maximiliano Sandoval
2024-02-13 9:28 ` [pbs-devel] partially-applied: " Fabian Grünbichler
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=20240212131734.454966-3-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 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