From a198d74fc02fd9067c92ec2ac9f9a34829adf3bf Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 25 Dec 2018 13:29:27 +0100 Subject: [PATCH] cleanup: reduce compiler warnings --- src/backup/chunk_store.rs | 6 +++--- src/backup/datastore.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/backup/chunk_store.rs b/src/backup/chunk_store.rs index 40034db9..1adb54a7 100644 --- a/src/backup/chunk_store.rs +++ b/src/backup/chunk_store.rs @@ -147,7 +147,7 @@ impl ChunkStore { pub fn touch_chunk(&self, digest:&[u8]) -> Result<(), Error> { - let mut chunk_path = self.chunk_dir.clone(); + let mut chunk_path = self.chunk_dir.clone(); let prefix = digest_to_prefix(&digest); chunk_path.push(&prefix); let digest_str = digest_to_hex(&digest); @@ -156,7 +156,7 @@ impl ChunkStore { const UTIME_NOW: i64 = ((1 << 30) - 1); const UTIME_OMIT: i64 = ((1 << 30) - 2); - let mut times: [libc::timespec; 2] = [ + let times: [libc::timespec; 2] = [ libc::timespec { tv_sec: 0, tv_nsec: UTIME_NOW }, libc::timespec { tv_sec: 0, tv_nsec: UTIME_OMIT } ]; @@ -231,7 +231,7 @@ impl ChunkStore { for i in 0..256 { let l1name = PathBuf::from(format!("{:02x}", i)); - let mut l1_handle = match nix::dir::Dir::openat( + let l1_handle = match nix::dir::Dir::openat( base_fd, &l1name, OFlag::O_RDONLY, Mode::empty()) { Ok(h) => h, Err(err) => bail!("unable to open store '{}' dir {:?}/{:?} - {}", diff --git a/src/backup/datastore.rs b/src/backup/datastore.rs index 03b07fec..5184055d 100644 --- a/src/backup/datastore.rs +++ b/src/backup/datastore.rs @@ -32,7 +32,7 @@ impl DataStore { if let Some(datastore) = map.get(name) { // Compare Config - if changed, create new Datastore object! - if (datastore.chunk_store.base == PathBuf::from(path)) { + if datastore.chunk_store.base == PathBuf::from(path) { return Ok(datastore.clone()); } } @@ -110,7 +110,7 @@ impl DataStore { pub fn garbage_collection(&self) -> Result<(), Error> { - if let Ok(ref mut mutex) = self.gc_mutex.try_lock() { + if let Ok(ref mut _mutex) = self.gc_mutex.try_lock() { let mut gc_status = GarbageCollectionStatus::default(); gc_status.used_bytes = 0;