We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 73980de commit 0f95f37Copy full SHA for 0f95f37
stackslib/src/chainstate/stacks/index/trie.rs
@@ -854,11 +854,10 @@ impl Trie {
854
children_root_hash: &TrieHash,
855
) -> Result<TrieHash, Error> {
856
let hashes = Trie::get_trie_root_ancestor_hashes_bytes(storage, children_root_hash)?;
857
- if hashes.len() == 1 {
858
- #[allow(clippy::indexing_slicing)]
859
- Ok(hashes[0])
860
- } else {
861
- Ok(TrieHash::from_data_array(hashes.as_slice()))
+ let hashes = Trie::get_trie_root_ancestor_hashes_bytes(storage, children_root_hash)?;
+ match hashes.as_slice() {
+ [single_hash] => Ok(*single_hash),
+ multiple_hashes => Ok(TrieHash::from_data_array(multiple_hashes)),
862
}
863
864
0 commit comments