public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox-backup-qemu 2/2] fix clippy warnings
Date: Wed, 24 Nov 2021 09:18:13 +0100	[thread overview]
Message-ID: <20211124081813.1559447-2-f.gruenbichler@proxmox.com> (raw)
In-Reply-To: <20211124081813.1559447-1-f.gruenbichler@proxmox.com>

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
---
 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





      reply	other threads:[~2021-11-24  8:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-05 12:19 [pve-devel] [proxmox-backup-qemu] update dependencies to latest proxmox-backup git version Dietmar Maurer
2021-11-24  8:18 ` [pve-devel] [PATCH proxmox-backup-qemu 1/2] update deps to pbs 2.1.1 Fabian Grünbichler
2021-11-24  8:18   ` Fabian Grünbichler [this message]

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=20211124081813.1559447-2-f.gruenbichler@proxmox.com \
    --to=f.gruenbichler@proxmox.com \
    --cc=pve-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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal