Don't manually implement hash_one

This commit is contained in:
Gwilym Inzani 2023-10-07 20:26:10 +01:00
parent 53685b0410
commit 426890e856

View file

@ -470,9 +470,7 @@ where
K: Borrow<Q>, K: Borrow<Q>,
Q: Hash + ?Sized, Q: Hash + ?Sized,
{ {
let mut hasher = self.hasher.build_hasher(); let result = self.hasher.hash_one(key);
key.hash(&mut hasher);
let result = hasher.finish();
// we want to allow truncation here since we're reducing 64 bits to 32 // we want to allow truncation here since we're reducing 64 bits to 32
#[allow(clippy::cast_possible_truncation)] #[allow(clippy::cast_possible_truncation)]