Use Hash::new_from_array() instead of TryFrom (#29720)
This commit is contained in:
parent
977d3453a3
commit
8a28877910
|
@ -84,7 +84,6 @@ use {
|
||||||
borrow::{Borrow, Cow},
|
borrow::{Borrow, Cow},
|
||||||
boxed::Box,
|
boxed::Box,
|
||||||
collections::{hash_map::Entry, BTreeSet, HashMap, HashSet},
|
collections::{hash_map::Entry, BTreeSet, HashMap, HashSet},
|
||||||
convert::TryFrom,
|
|
||||||
hash::{Hash as StdHash, Hasher as StdHasher},
|
hash::{Hash as StdHash, Hasher as StdHasher},
|
||||||
io::{Error as IoError, Result as IoResult},
|
io::{Error as IoError, Result as IoResult},
|
||||||
ops::{Range, RangeBounds},
|
ops::{Range, RangeBounds},
|
||||||
|
@ -5899,9 +5898,7 @@ impl AccountsDb {
|
||||||
hasher.update(owner.as_ref());
|
hasher.update(owner.as_ref());
|
||||||
hasher.update(pubkey.as_ref());
|
hasher.update(pubkey.as_ref());
|
||||||
|
|
||||||
Hash::new_from_array(
|
Hash::new_from_array(hasher.finalize().into())
|
||||||
<[u8; solana_sdk::hash::HASH_BYTES]>::try_from(hasher.finalize().as_slice()).unwrap(),
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bulk_assign_write_version(&self, count: usize) -> StoredMetaWriteVersion {
|
fn bulk_assign_write_version(&self, count: usize) -> StoredMetaWriteVersion {
|
||||||
|
|
Loading…
Reference in New Issue