Skip to content

Commit 0c74c08

Browse files
mina86mzabaluev
authored andcommitted
tendermint: simplify GenericArray → [u8; N] conversion (#1390)
1 parent 1bee917 commit 0c74c08

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tendermint/src/crypto/default.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ pub use sha2::Sha256;
1515

1616
impl super::Sha256 for Sha256 {
1717
fn digest(data: impl AsRef<[u8]>) -> [u8; HASH_SIZE] {
18-
let digest = <Self as Digest>::digest(data);
19-
// copy the GenericArray out
20-
let mut hash = [0u8; HASH_SIZE];
21-
hash.copy_from_slice(&digest);
22-
hash
18+
<Self as Digest>::digest(data).into()
2319
}
2420
}
2521

0 commit comments

Comments
 (0)