File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -498,7 +498,7 @@ mod tests {
498498 #[ test]
499499 pub fn mpt_short ( ) {
500500 // 4 leaves with 1-byte long keys, the resulting root node should be shorter than 32 bytes
501- let leaves: BTreeMap < _ , _ > = ( 0 ..4u8 ) . map ( |i| ( Nibbles :: unpack ( & [ i] ) , vec ! [ 0 ] ) ) . collect ( ) ;
501+ let leaves: BTreeMap < _ , _ > = ( 0 ..4u8 ) . map ( |i| ( Nibbles :: unpack ( [ i] ) , vec ! [ 0 ] ) ) . collect ( ) ;
502502
503503 // construct the root hash and inclusion proofs for all leaves
504504 let proof_keys = leaves. keys ( ) . cloned ( ) . collect ( ) ;
Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ fn get_leaf_val_mut(trie: &mut Value) -> Option<&mut Value> {
175175 "Extension" => get_leaf_val_mut ( & mut value[ 1 ] ) ,
176176 "Branch" => {
177177 let children = value. as_array_mut ( ) . unwrap ( ) ;
178- children. into_iter ( ) . find_map ( |c| get_leaf_val_mut ( c) )
178+ children. iter_mut ( ) . find_map ( |c| get_leaf_val_mut ( c) )
179179 }
180180 "Digest" => None ,
181181 _ => unreachable ! ( ) ,
@@ -213,7 +213,7 @@ async fn corrupt_storage_trie() {
213213
214214 // corrupt the trie by getting the first child node and deleting it
215215 let child_array = storage_trie_value[ "Branch" ] . as_array_mut ( ) . unwrap ( ) ;
216- let child_value = child_array. into_iter ( ) . find ( |c| !c. is_null ( ) ) . unwrap ( ) ;
216+ let child_value = child_array. iter_mut ( ) . find ( |c| !c. is_null ( ) ) . unwrap ( ) ;
217217 * child_value = Value :: Null ;
218218
219219 // executing this on the guest should panic
@@ -253,7 +253,7 @@ async fn corrupt_state_trie() {
253253
254254 // corrupt the trie by getting the first child node and deleting it
255255 let children = state_trie_value[ "Branch" ] . as_array_mut ( ) . unwrap ( ) ;
256- let child_value = children. into_iter ( ) . find ( |c| !c. is_null ( ) ) . unwrap ( ) ;
256+ let child_value = children. iter_mut ( ) . find ( |c| !c. is_null ( ) ) . unwrap ( ) ;
257257 * child_value = Value :: Null ;
258258
259259 // executing this on the guest should panic
You can’t perform that action at this time.
0 commit comments