From 5fe7924049f39fc6cf772605efc5c28b3ecbae78 Mon Sep 17 00:00:00 2001 From: Jacob Lee Date: Sat, 27 Nov 2021 08:16:36 -0800 Subject: [PATCH] Stop calling `state.finish()` for fixed hashes (#602) Calling [`state.finish();`][Hasher::finish] is a no-op. At call site, `state` is read-only and the return value is ignored. The call and may be removed. [Hasher::finish]: https://doc.rust-lang.org/std/hash/trait.Hasher.html#tymethod.finish --- fixed-hash/src/hash.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/fixed-hash/src/hash.rs b/fixed-hash/src/hash.rs index 3d0ca6990..232245868 100644 --- a/fixed-hash/src/hash.rs +++ b/fixed-hash/src/hash.rs @@ -274,7 +274,6 @@ macro_rules! construct_fixed_hash { impl $crate::core_::hash::Hash for $name { fn hash(&self, state: &mut H) where H: $crate::core_::hash::Hasher { state.write(&self.0); - state.finish(); } }