From acbf2db3b3bc131ddac64731ae7d31f351074674 Mon Sep 17 00:00:00 2001 From: pdtfh <149602456+pdtfh@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:55:21 +0200 Subject: [PATCH] cargo fmt --- benches/lazy_merkle_tree.rs | 5 ++--- src/packed_proof.rs | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/benches/lazy_merkle_tree.rs b/benches/lazy_merkle_tree.rs index e69f6e0..30c2ea9 100644 --- a/benches/lazy_merkle_tree.rs +++ b/benches/lazy_merkle_tree.rs @@ -74,18 +74,17 @@ fn bench_restore_dense_mmap_tree(criterion: &mut Criterion) { create_values_for_tree(14), ]; - let mut group = criterion.benchmark_group("bench_restore_dense_mmap_tree"); (0..3).zip(tree_values).for_each(|(id, value)| { - + let file = tempfile::NamedTempFile::new().unwrap(); let path = file.path().to_str().unwrap(); { let _tree = LazyMerkleTree::::new_mmapped_with_dense_prefix_with_init_values(value.depth, value.prefix_depth, &value.empty_value, &value.initial_values, path).unwrap(); let _root = _tree.root(); } - + group.bench_with_input( BenchmarkId::from_parameter(format!("restore_dense_mmap_tree_depth_{}", value.depth)), &(id, value), diff --git a/src/packed_proof.rs b/src/packed_proof.rs index 0e0648b..3354864 100644 --- a/src/packed_proof.rs +++ b/src/packed_proof.rs @@ -10,7 +10,8 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; use crate::util::{bytes_from_hex, bytes_to_hex, deserialize_bytes, serialize_bytes}; -/// A packed proof is a representation of the ZKP in a single attribute (as opposed to array of arrays) which is easier to transport +/// A packed proof is a representation of the ZKP in a single attribute (as +/// opposed to array of arrays) which is easier to transport #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct PackedProof(pub [u8; 256]); @@ -43,10 +44,10 @@ impl From for Proof { .collect::>(); let a = (decoded_uint_array[0], decoded_uint_array[1]); - let b = ( - [decoded_uint_array[2], decoded_uint_array[3]], - [decoded_uint_array[4], decoded_uint_array[5]], - ); + let b = ([decoded_uint_array[2], decoded_uint_array[3]], [ + decoded_uint_array[4], + decoded_uint_array[5], + ]); let c = (decoded_uint_array[6], decoded_uint_array[7]); Self(a, b, c) } @@ -92,10 +93,10 @@ pub mod test { fn test_serializing_proof_into_packed_proof() { let proof = Proof( (U256::from(1), U256::from(2)), - ( - [U256::from(3), U256::from(4)], - [U256::from(5), U256::from(6)], - ), + ([U256::from(3), U256::from(4)], [ + U256::from(5), + U256::from(6), + ]), (U256::from(7), U256::from(8)), );