Skip to content

Commit

Permalink
Stop calling state.finish() for fixed hashes (#602)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Jacob Lee authored Nov 27, 2021
1 parent c3ef97d commit 5fe7924
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion fixed-hash/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ macro_rules! construct_fixed_hash {
impl $crate::core_::hash::Hash for $name {
fn hash<H>(&self, state: &mut H) where H: $crate::core_::hash::Hasher {
state.write(&self.0);
state.finish();
}
}

Expand Down

0 comments on commit 5fe7924

Please sign in to comment.