diff --git a/miden-crypto/src/merkle/mmr/tests.rs b/miden-crypto/src/merkle/mmr/tests.rs index af892f4..e47a7c3 100644 --- a/miden-crypto/src/merkle/mmr/tests.rs +++ b/miden-crypto/src/merkle/mmr/tests.rs @@ -497,12 +497,14 @@ fn test_bit_position_iterator() { assert_eq!(TrueBitPositionIterator::new(3).collect::>(), vec![0, 1],); assert_eq!(TrueBitPositionIterator::new(3).rev().collect::>(), vec![1, 0],); - assert_eq!(TrueBitPositionIterator::new(0b11010101).collect::>(), vec![ - 0, 2, 4, 6, 7 - ],); - assert_eq!(TrueBitPositionIterator::new(0b11010101).rev().collect::>(), vec![ - 7, 6, 4, 2, 0 - ],); + assert_eq!( + TrueBitPositionIterator::new(0b11010101).collect::>(), + vec![0, 2, 4, 6, 7], + ); + assert_eq!( + TrueBitPositionIterator::new(0b11010101).rev().collect::>(), + vec![7, 6, 4, 2, 0], + ); } #[test] diff --git a/miden-crypto/src/merkle/partial_mt/mod.rs b/miden-crypto/src/merkle/partial_mt/mod.rs index 6698ba9..be7e94c 100644 --- a/miden-crypto/src/merkle/partial_mt/mod.rs +++ b/miden-crypto/src/merkle/partial_mt/mod.rs @@ -200,10 +200,13 @@ impl PartialMerkleTree { pub fn to_paths(&self) -> Vec<(NodeIndex, ValuePath)> { let mut paths = Vec::new(); self.leaves.iter().for_each(|&leaf| { - paths.push((leaf, ValuePath { - value: self.get_node(leaf).expect("Failed to get leaf node"), - path: self.get_path(leaf).expect("Failed to get path"), - })); + paths.push(( + leaf, + ValuePath { + value: self.get_node(leaf).expect("Failed to get leaf node"), + path: self.get_path(leaf).expect("Failed to get path"), + }, + )); }); paths } diff --git a/miden-crypto/src/merkle/partial_mt/tests.rs b/miden-crypto/src/merkle/partial_mt/tests.rs index 0f57ab5..6723ba1 100644 --- a/miden-crypto/src/merkle/partial_mt/tests.rs +++ b/miden-crypto/src/merkle/partial_mt/tests.rs @@ -215,10 +215,13 @@ fn get_paths() { let expected_paths: Vec<(NodeIndex, ValuePath)> = leaves .iter() .map(|&leaf| { - (leaf, ValuePath { - value: mt.get_node(leaf).unwrap(), - path: mt.get_path(leaf).unwrap(), - }) + ( + leaf, + ValuePath { + value: mt.get_node(leaf).unwrap(), + path: mt.get_path(leaf).unwrap(), + }, + ) }) .collect(); diff --git a/miden-crypto/src/merkle/smt/full/tests.rs b/miden-crypto/src/merkle/smt/full/tests.rs index d050c40..d793a27 100644 --- a/miden-crypto/src/merkle/smt/full/tests.rs +++ b/miden-crypto/src/merkle/smt/full/tests.rs @@ -661,12 +661,10 @@ fn test_empty_smt_leaf_serialization() { #[test] fn test_single_smt_leaf_serialization() { - let single_leaf = SmtLeaf::new_single(RpoDigest::from([10_u32, 11_u32, 12_u32, 13_u32]), [ - 1_u32.into(), - 2_u32.into(), - 3_u32.into(), - 4_u32.into(), - ]); + let single_leaf = SmtLeaf::new_single( + RpoDigest::from([10_u32, 11_u32, 12_u32, 13_u32]), + [1_u32.into(), 2_u32.into(), 3_u32.into(), 4_u32.into()], + ); let mut serialized = single_leaf.to_bytes(); // extend buffer with random bytes @@ -679,18 +677,14 @@ fn test_single_smt_leaf_serialization() { #[test] fn test_multiple_smt_leaf_serialization_success() { let multiple_leaf = SmtLeaf::new_multiple(vec![ - (RpoDigest::from([10_u32, 11_u32, 12_u32, 13_u32]), [ - 1_u32.into(), - 2_u32.into(), - 3_u32.into(), - 4_u32.into(), - ]), - (RpoDigest::from([100_u32, 101_u32, 102_u32, 13_u32]), [ - 11_u32.into(), - 12_u32.into(), - 13_u32.into(), - 14_u32.into(), - ]), + ( + RpoDigest::from([10_u32, 11_u32, 12_u32, 13_u32]), + [1_u32.into(), 2_u32.into(), 3_u32.into(), 4_u32.into()], + ), + ( + RpoDigest::from([100_u32, 101_u32, 102_u32, 13_u32]), + [11_u32.into(), 12_u32.into(), 13_u32.into(), 14_u32.into()], + ), ]) .unwrap();