Use Hash::new_from_array() instead of TryFrom (#29720)

This commit is contained in:
Brooks 2023-01-16 10:53:38 -05:00 committed by GitHub
parent 977d3453a3
commit 8a28877910
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -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 {