diff --git a/src/config.rs b/src/config.rs index 6dae50d51..f50076f61 100644 --- a/src/config.rs +++ b/src/config.rs @@ -524,7 +524,7 @@ impl Config { self.get_path().join("DO_NOT_USE_THIS_DIRECTORY_FOR_ANYTHING"), ); - let file = self.try_lock(options.open(&self.db_path())?)?; + let file = self.try_lock(options.open(self.db_path())?)?; maybe_fsync_directory(self.get_path())?; Ok(file) } @@ -619,7 +619,7 @@ impl Config { fn write_config(&self) -> Result<()> { let bytes = self.serialize(); - let crc: u32 = crc32(&*bytes); + let crc: u32 = crc32(&bytes); let crc_arr = u32_to_arr(crc); let temp_path = self.get_path().join("conf.tmp"); @@ -629,7 +629,7 @@ impl Config { fs::OpenOptions::new().write(true).create(true).open(&temp_path)?; io_fail!(self, "write_config bytes"); - f.write_all(&*bytes)?; + f.write_all(&bytes)?; io_fail!(self, "write_config crc"); f.write_all(&crc_arr)?; io_fail!(self, "write_config fsync"); @@ -672,7 +672,7 @@ impl Config { f.read_exact(&mut crc_arr)?; let crc_expected = arr_to_u32(&crc_arr); - let crc_actual = crc32(&*buf); + let crc_actual = crc32(&buf); if crc_expected != crc_actual { warn!( @@ -771,7 +771,7 @@ impl Drop for Inner { if self.temporary { // Our files are temporary, so nuke them. debug!("removing temporary storage file {:?}", self.get_path()); - let _res = fs::remove_dir_all(&self.get_path()); + let _res = fs::remove_dir_all(self.get_path()); } } } diff --git a/src/ebr/internal.rs b/src/ebr/internal.rs index 851d410bc..8620d0f5b 100644 --- a/src/ebr/internal.rs +++ b/src/ebr/internal.rs @@ -441,7 +441,7 @@ impl Local { /// Returns a reference to the `Collector` in which this `Local` resides. #[inline] pub(super) fn collector(&self) -> &Collector { - unsafe { &**self.collector.get() } + unsafe { &*self.collector.get() } } /// Adds `deferred` to the thread-local bag. diff --git a/src/histogram.rs b/src/histogram.rs index b18f119f5..544872aa4 100644 --- a/src/histogram.rs +++ b/src/histogram.rs @@ -95,7 +95,7 @@ impl Debug for Histogram { for p in &PS { let res = self.percentile(*p).round(); let line = format!("({} -> {}) ", p, res); - f.write_str(&*line)?; + f.write_str(&line)?; } f.write_str("]") diff --git a/src/lru.rs b/src/lru.rs index f69eaa5b8..730c15858 100644 --- a/src/lru.rs +++ b/src/lru.rs @@ -64,9 +64,7 @@ impl AccessBlock { impl Default for AccessQueue { fn default() -> AccessQueue { AccessQueue { - writing: AtomicPtr::new(Box::into_raw(Box::new( - AccessBlock::default(), - ))), + writing: AtomicPtr::new(Box::into_raw(Box::default())), full_list: AtomicPtr::default(), } } diff --git a/src/node.rs b/src/node.rs index 2cfee072f..29ae32c8c 100644 --- a/src/node.rs +++ b/src/node.rs @@ -2143,7 +2143,7 @@ impl Inner { u8::try_from(prefix_len).unwrap(), self.is_index, other_next, - &*items, + &items, ); ret.rewrite_generations = diff --git a/src/pagecache/heap.rs b/src/pagecache/heap.rs index f594d396d..cf9595e72 100644 --- a/src/pagecache/heap.rs +++ b/src/pagecache/heap.rs @@ -216,7 +216,7 @@ impl Heap { } } - let iter = self.slabs.iter().zip(bitmaps.into_iter()); + let iter = self.slabs.iter().zip(bitmaps); for (slab, bitmap) in iter { let tip = slab.tip.load(Acquire); diff --git a/src/pagecache/mod.rs b/src/pagecache/mod.rs index 706d33d13..a0b31ec69 100644 --- a/src/pagecache/mod.rs +++ b/src/pagecache/mod.rs @@ -464,7 +464,7 @@ impl Debug for PageCache { &self, f: &mut fmt::Formatter<'_>, ) -> std::result::Result<(), fmt::Error> { - f.write_str(&*format!( + f.write_str(&format!( "PageCache {{ max: {:?} free: {:?} }}\n", *self.next_pid_to_allocate.lock(), self.free diff --git a/src/pagecache/segment.rs b/src/pagecache/segment.rs index fbf301ae4..f1b4f57d2 100644 --- a/src/pagecache/segment.rs +++ b/src/pagecache/segment.rs @@ -636,7 +636,7 @@ impl SegmentAccountant { io_fail!(self.config, "zero garbage segment SA"); pwrite_all( &self.config.file, - &*vec![MessageKind::Corrupted.into(); self.config.segment_size], + &vec![MessageKind::Corrupted.into(); self.config.segment_size], segment_base, )?; } diff --git a/src/pagecache/snapshot.rs b/src/pagecache/snapshot.rs index 142fba6d6..da2dabf26 100644 --- a/src/pagecache/snapshot.rs +++ b/src/pagecache/snapshot.rs @@ -455,7 +455,7 @@ fn advance_snapshot( io_fail!(config, "segment initial free zero"); pwrite_all( &config.file, - &*vec![MessageKind::Corrupted.into(); config.segment_size], + &vec![MessageKind::Corrupted.into(); config.segment_size], *to_zero, )?; if !config.temporary { @@ -560,7 +560,7 @@ pub(in crate::pagecache) fn write_snapshot( // write the snapshot bytes, followed by a crc64 checksum at the end io_fail!(config, "snap write"); - f.write_all(&*bytes)?; + f.write_all(&bytes)?; io_fail!(config, "snap write len"); f.write_all(&len_bytes)?; io_fail!(config, "snap write crc"); diff --git a/src/stack.rs b/src/stack.rs index 89ccb1cac..1341bcc6f 100644 --- a/src/stack.rs +++ b/src/stack.rs @@ -77,7 +77,7 @@ where if written { formatter.write_str(", ")?; } - formatter.write_str(&*format!("({:?}) ", &node))?; + formatter.write_str(&format!("({:?}) ", &node))?; node.fmt(formatter)?; written = true; } diff --git a/src/sys_limits.rs b/src/sys_limits.rs index 1582062be..9de8b42a8 100644 --- a/src/sys_limits.rs +++ b/src/sys_limits.rs @@ -2,7 +2,7 @@ #[cfg(any(target_os = "linux", target_os = "macos"))] use std::io; -#[cfg(any(target_os = "linux"))] +#[cfg(target_os = "linux")] use {std::fs::File, std::io::Read}; use std::convert::TryFrom; diff --git a/src/transaction.rs b/src/transaction.rs index a2bd6e69f..626ffec94 100644 --- a/src/transaction.rs +++ b/src/transaction.rs @@ -510,7 +510,7 @@ impl Transactional for &&Tree { fn make_overlay(&self) -> Result { Ok(TransactionalTrees { - inner: vec![TransactionalTree::from_tree(*self)], + inner: vec![TransactionalTree::from_tree(self)], }) } diff --git a/src/tree.rs b/src/tree.rs index b1a540afa..3e4691a3d 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -20,7 +20,7 @@ impl<'g> Deref for View<'g> { type Target = Node; fn deref(&self) -> &Node { - &*self.node_view + &self.node_view } }