[pbs-devel] [PATCH proxmox-backup-qemu 2/6] clippy fixes

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Dec 12 13:05:37 CET 2022


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 src/commands.rs     | 8 ++++----
 src/upload_queue.rs | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/commands.rs b/src/commands.rs
index 27d958c..37d653c 100644
--- a/src/commands.rs
+++ b/src/commands.rs
@@ -74,7 +74,7 @@ async fn register_zero_chunk(
 
     let param = json!({
         "wid": wid,
-        "digest": hex::encode(&zero_chunk_digest),
+        "digest": hex::encode(zero_chunk_digest),
         "size": chunk_size,
         "encoded-size": chunk_data.len(),
     });
@@ -212,7 +212,7 @@ pub(crate) async fn register_image(
         let csum = PREVIOUS_CSUMS.lock().unwrap().get(&device_name).copied();
 
         if let Some(csum) = csum {
-            param["reuse-csum"] = hex::encode(&csum).into();
+            param["reuse-csum"] = hex::encode(csum).into();
 
             match index {
                 Some(index) => {
@@ -308,7 +308,7 @@ pub(crate) async fn close_image(
         }
     };
 
-    let csum = hex::encode(&upload_result.csum);
+    let csum = hex::encode(upload_result.csum);
 
     let param = json!({
         "wid": wid ,
@@ -399,7 +399,7 @@ pub(crate) async fn write_data(
                 Box::new(futures::future::ok(upload_info))
             } else {
                 let (chunk, digest) = chunk_builder.build()?;
-                let digest_str = hex::encode(&digest);
+                let digest_str = hex::encode(digest);
                 let chunk_data = chunk.into_inner();
 
                 let param = json!({
diff --git a/src/upload_queue.rs b/src/upload_queue.rs
index 941734b..261886c 100644
--- a/src/upload_queue.rs
+++ b/src/upload_queue.rs
@@ -111,7 +111,7 @@ async fn upload_handler(
                 size,
                 chunk_is_known,
             }) => {
-                let digest_str = hex::encode(&digest);
+                let digest_str = hex::encode(digest);
 
                 //println!("upload_handler {:?} {}", digest, offset);
                 let pos = (offset / chunk_size) as usize;
-- 
2.30.2






More information about the pbs-devel mailing list