Skip to content

Commit 7d506e3

Browse files
committed
Fix clippy
1 parent 63968ab commit 7d506e3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/map.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,7 @@ where
242242
Q: Hash + ?Sized,
243243
S: BuildHasher,
244244
{
245-
use core::hash::Hasher;
246-
let mut state = hash_builder.build_hasher();
247-
val.hash(&mut state);
248-
state.finish()
245+
hash_builder.hash_one(val)
249246
}
250247

251248
#[cfg(feature = "nightly")]
@@ -2022,7 +2019,7 @@ where
20222019
}
20232020

20242021
self.iter()
2025-
.all(|(key, value)| other.get(key).map_or(false, |v| *value == *v))
2022+
.all(|(key, value)| other.get(key).is_some_and(|v| *value == *v))
20262023
}
20272024
}
20282025

@@ -4486,7 +4483,7 @@ where
44864483
let reserve = if self.is_empty() {
44874484
iter.size_hint().0
44884485
} else {
4489-
(iter.size_hint().0 + 1) / 2
4486+
iter.size_hint().0.div_ceil(2)
44904487
};
44914488
self.reserve(reserve);
44924489
iter.for_each(move |(k, v)| {

0 commit comments

Comments
 (0)