Skip to content

Commit

Permalink
Use Into in Hash::result() instead of TryFrom (#29721)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Jan 16, 2023
1 parent 8a28877 commit da39c48
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions sdk/program/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ impl Hasher {
}
}
pub fn result(self) -> Hash {
// At the time of this writing, the sha2 library is stuck on an old version
// of generic_array (0.9.0). Decouple ourselves with a clone to our version.
Hash(<[u8; HASH_BYTES]>::try_from(self.hasher.finalize().as_slice()).unwrap())
Hash(self.hasher.finalize().into())
}
}

Expand Down

0 comments on commit da39c48

Please sign in to comment.