From 5a64e13099225c044ca1773029eb01ae7eb716c3 Mon Sep 17 00:00:00 2001 From: Michal Nazarewicz Date: Thu, 1 Feb 2024 19:22:31 +0100 Subject: [PATCH] =?UTF-8?q?tendermint:=20simplify=20GenericArray=20?= =?UTF-8?q?=E2=86=92=20[u8;=20N]=20conversion=20(#1390)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cometbft/src/crypto/default.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cometbft/src/crypto/default.rs b/cometbft/src/crypto/default.rs index 441c35ad..c057a95d 100644 --- a/cometbft/src/crypto/default.rs +++ b/cometbft/src/crypto/default.rs @@ -15,11 +15,7 @@ pub use sha2::Sha256; impl super::Sha256 for Sha256 { fn digest(data: impl AsRef<[u8]>) -> [u8; HASH_SIZE] { - let digest = ::digest(data); - // copy the GenericArray out - let mut hash = [0u8; HASH_SIZE]; - hash.copy_from_slice(&digest); - hash + ::digest(data).into() } }