Skip to content

Commit

Permalink
reuse Copy trait in hash::clone() (#767)
Browse files Browse the repository at this point in the history
  • Loading branch information
svyatonik authored Jul 12, 2023
1 parent 7194def commit d3a9327
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions fixed-hash/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,7 @@ macro_rules! construct_fixed_hash {
#[cfg_attr(feature = "dev", allow(expl_impl_clone_on_copy))]
impl $crate::core_::clone::Clone for $name {
fn clone(&self) -> $name {
let mut ret = $name::zero();
ret.0.copy_from_slice(&self.0);
ret
*self
}
}

Expand Down

0 comments on commit d3a9327

Please sign in to comment.