Skip to content

Commit

Permalink
Use Hash::new_from_array() instead of TryFrom (#29720)
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo authored Jan 16, 2023
1 parent 977d345 commit 8a28877
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 8a28877

Please sign in to comment.