From 43e86f31de27ba3aa44e70dca852382dfbc0482e Mon Sep 17 00:00:00 2001 From: Dennis Schwerdel Date: Wed, 19 Apr 2017 22:52:27 +0200 Subject: [PATCH] Making clippy happy in index and maybe fixed a bug --- index/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index/src/lib.rs b/index/src/lib.rs index f1bd6c5..82b066b 100644 --- a/index/src/lib.rs +++ b/index/src/lib.rs @@ -149,7 +149,7 @@ impl Index { header.entries = 0; header.capacity = INITIAL_SIZE as u64; } - if &header.magic != magic { + if header.magic != *magic { return Err(IndexError::WrongMagic); } if header.version != version { @@ -313,7 +313,7 @@ impl Index { if entry.key == *key { return LocateResult::Found(pos); } - let odist = (pos + self.capacity - entry.key.hash() as usize & self.mask) & self.mask; + let odist = (pos + self.capacity - (entry.key.hash() as usize & self.mask)) & self.mask; if dist > odist { return LocateResult::Steal(pos); } @@ -466,8 +466,8 @@ impl Index { } #[inline] - pub fn iter<'a>(&'a self) -> Iter<'a, K, V> { - Iter{items: &self.data} + pub fn iter(&self) -> Iter { + Iter{items: self.data} } #[inline]