From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 654469098E for ; Mon, 12 Feb 2024 14:17:37 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4E3D819214 for ; Mon, 12 Feb 2024 14:17:37 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 12 Feb 2024 14:17:36 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 5F18E478DD for ; Mon, 12 Feb 2024 14:17:36 +0100 (CET) From: Maximiliano Sandoval To: pbs-devel@lists.proxmox.com Date: Mon, 12 Feb 2024 14:17:28 +0100 Message-Id: <20240212131734.454966-3-m.sandoval@proxmox.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212131734.454966-1-m.sandoval@proxmox.com> References: <20240212131734.454966-1-m.sandoval@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 1 AWL -0.048 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy FSL_BULK_SIG 0.001 Bulk signature with no Unsubscribe KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RAZOR2_CF_RANGE_51_100 1.886 Razor2 gives confidence level above 50% RAZOR2_CHECK 0.922 Listed in Razor2 (http://razor.sf.net/) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_SBL_A 0.1 Contains URL's A record listed in the Spamhaus SBL blocklist [185.199.111.153, 185.199.109.153, 185.199.108.153, 185.199.110.153] Subject: [pbs-devel] [PATCH backup 03/13] remove needless borrows X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Feb 2024 13:17:37 -0000 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 --- 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) { - 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) -> 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