diff --git a/src/lib.rs b/src/lib.rs index ff64e87e..34e5d8ba 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -270,7 +270,7 @@ impl<'a, K: 'a + Eq + Hash, V: 'a, S: BuildHasher + Clone> DashMap { hasher: S, shard_amount: usize, ) -> Self { - assert!(shard_amount > 0); + assert!(shard_amount > 1); assert!(shard_amount.is_power_of_two()); let shift = util::ptr_size_bits() - ncb(shard_amount); diff --git a/src/mapref/entry.rs b/src/mapref/entry.rs index 3fc007ca..e9e6b913 100644 --- a/src/mapref/entry.rs +++ b/src/mapref/entry.rs @@ -159,9 +159,7 @@ impl<'a, K: Eq + Hash, V, S: BuildHasher> VacantEntry<'a, K, V, S> { let kptr: *const K = k; let vptr: *mut V = v.as_ptr(); - let r = OccupiedEntry::new(self.shard, self.key, (kptr, vptr)); - - r + OccupiedEntry::new(self.shard, self.key, (kptr, vptr)) } }