From 8a288779105400b96fb198012f15b97663c151d0 Mon Sep 17 00:00:00 2001 From: Brooks Date: Mon, 16 Jan 2023 10:53:38 -0500 Subject: [PATCH] Use Hash::new_from_array() instead of TryFrom (#29720) --- runtime/src/accounts_db.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/runtime/src/accounts_db.rs b/runtime/src/accounts_db.rs index 025bee4e95..38851293b9 100644 --- a/runtime/src/accounts_db.rs +++ b/runtime/src/accounts_db.rs @@ -84,7 +84,6 @@ use { borrow::{Borrow, Cow}, boxed::Box, collections::{hash_map::Entry, BTreeSet, HashMap, HashSet}, - convert::TryFrom, hash::{Hash as StdHash, Hasher as StdHasher}, io::{Error as IoError, Result as IoResult}, ops::{Range, RangeBounds}, @@ -5899,9 +5898,7 @@ impl AccountsDb { hasher.update(owner.as_ref()); hasher.update(pubkey.as_ref()); - Hash::new_from_array( - <[u8; solana_sdk::hash::HASH_BYTES]>::try_from(hasher.finalize().as_slice()).unwrap(), - ) + Hash::new_from_array(hasher.finalize().into()) } fn bulk_assign_write_version(&self, count: usize) -> StoredMetaWriteVersion {