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 EB8CD815D1 for ; Wed, 24 Nov 2021 09:18:27 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E9B711BA74 for ; Wed, 24 Nov 2021 09:18:27 +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 id 79BC21BA69 for ; Wed, 24 Nov 2021 09:18:27 +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 4D6F8443A7 for ; Wed, 24 Nov 2021 09:18:21 +0100 (CET) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pve-devel@lists.proxmox.com Date: Wed, 24 Nov 2021 09:18:13 +0100 Message-Id: <20211124081813.1559447-2-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211124081813.1559447-1-f.gruenbichler@proxmox.com> References: <20211105121909.2957236-1-dietmar@proxmox.com> <20211124081813.1559447-1-f.gruenbichler@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.256 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pve-devel] [PATCH proxmox-backup-qemu 2/2] fix clippy warnings X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Nov 2021 08:18:28 -0000 Signed-off-by: Fabian Grünbichler --- src/commands.rs | 10 ++-------- src/restore.rs | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/commands.rs b/src/commands.rs index c2a1abb..16dc63f 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -133,7 +133,7 @@ pub(crate) fn check_last_incremental_csum( ) -> bool { match PREVIOUS_CSUMS.lock().unwrap().get(device_name) { - Some(csum) => manifest.verify_file(&archive_name(device_name), &csum, device_size).is_ok(), + Some(csum) => manifest.verify_file(&archive_name(device_name), csum, device_size).is_ok(), None => false, } } @@ -203,13 +203,7 @@ pub(crate) async fn register_image( let mut initial_index = Arc::new(None); if incremental { - let csum = { - let map = PREVIOUS_CSUMS.lock().unwrap(); - match map.get(&device_name) { - Some(c) => Some(*c), - None => None - } - }; + let csum = PREVIOUS_CSUMS.lock().unwrap().get(&device_name).copied(); if let Some(csum) = csum { param["reuse-csum"] = proxmox::tools::digest_to_hex(&csum).into(); diff --git a/src/restore.rs b/src/restore.rs index 2bc86c9..f70f2ec 100644 --- a/src/restore.rs +++ b/src/restore.rs @@ -172,7 +172,7 @@ impl RestoreTask { bytes += index.chunk_size; zeroes += index.chunk_size; } else { - let raw_data = ReadChunk::read_chunk(&chunk_reader, &digest)?; + let raw_data = ReadChunk::read_chunk(&chunk_reader, digest)?; let res = write_data_callback(offset, &raw_data); if res < 0 { bail!("write_data_callback failed ({})", res); -- 2.30.2