[pbs-devel] [PATCH proxmox-backup 2/8] clippy: fix Mutex with unused value

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Jan 20 17:23:49 CET 2021


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 src/api2/node/dns.rs      | 2 +-
 src/backup/chunk_store.rs | 4 ++--
 src/backup/datastore.rs   | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/api2/node/dns.rs b/src/api2/node/dns.rs
index 9a22bf60..e3dd614d 100644
--- a/src/api2/node/dns.rs
+++ b/src/api2/node/dns.rs
@@ -125,7 +125,7 @@ pub fn update_dns(
 ) -> Result<Value, Error> {
 
     lazy_static! {
-        static ref MUTEX: Arc<Mutex<usize>> = Arc::new(Mutex::new(0));
+        static ref MUTEX: Arc<Mutex<()>> = Arc::new(Mutex::new(()));
     }
 
     let _guard = MUTEX.lock();
diff --git a/src/backup/chunk_store.rs b/src/backup/chunk_store.rs
index f782169d..cc4a9435 100644
--- a/src/backup/chunk_store.rs
+++ b/src/backup/chunk_store.rs
@@ -18,7 +18,7 @@ pub struct ChunkStore {
     name: String, // used for error reporting
     pub (crate) base: PathBuf,
     chunk_dir: PathBuf,
-    mutex: Mutex<bool>,
+    mutex: Mutex<()>,
     locker: Arc<Mutex<tools::ProcessLocker>>,
 }
 
@@ -143,7 +143,7 @@ impl ChunkStore {
             base,
             chunk_dir,
             locker,
-            mutex: Mutex::new(false)
+            mutex: Mutex::new(())
         })
     }
 
diff --git a/src/backup/datastore.rs b/src/backup/datastore.rs
index b1099460..34865380 100644
--- a/src/backup/datastore.rs
+++ b/src/backup/datastore.rs
@@ -37,7 +37,7 @@ lazy_static! {
 /// management interface for backup.
 pub struct DataStore {
     chunk_store: Arc<ChunkStore>,
-    gc_mutex: Mutex<bool>,
+    gc_mutex: Mutex<()>,
     last_gc_status: Mutex<GarbageCollectionStatus>,
     verify_new: bool,
 }
@@ -89,7 +89,7 @@ impl DataStore {
 
         Ok(Self {
             chunk_store: Arc::new(chunk_store),
-            gc_mutex: Mutex::new(false),
+            gc_mutex: Mutex::new(()),
             last_gc_status: Mutex::new(gc_status),
             verify_new: config.verify_new.unwrap_or(false),
         })
-- 
2.20.1






More information about the pbs-devel mailing list