From 3edc5673cecb7a4adb6a0c4a52cefae30628aee4 Mon Sep 17 00:00:00 2001 From: Mario Rugiero Date: Mon, 30 Oct 2023 17:34:22 -0300 Subject: [PATCH] clippy --- .../builtin_hint_processor/cairo_keccak/keccak_hints.rs | 4 ++-- .../hint_processor/builtin_hint_processor/keccak_utils.rs | 6 +++--- vm/src/hint_processor/builtin_hint_processor/uint384.rs | 2 +- vm/src/math_utils/mod.rs | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/vm/src/hint_processor/builtin_hint_processor/cairo_keccak/keccak_hints.rs b/vm/src/hint_processor/builtin_hint_processor/cairo_keccak/keccak_hints.rs index 4a7ff55405..0beea39ee9 100644 --- a/vm/src/hint_processor/builtin_hint_processor/cairo_keccak/keccak_hints.rs +++ b/vm/src/hint_processor/builtin_hint_processor/cairo_keccak/keccak_hints.rs @@ -56,8 +56,8 @@ pub fn keccak_write_args( let high = get_integer_from_var_name("high", vm, ids_data, ap_tracking)?; let bound = pow2_const_nz(64); - let (d1, d0) = low.div_rem(&bound); - let (d3, d2) = high.div_rem(&bound); + let (d1, d0) = low.div_rem(bound); + let (d3, d2) = high.div_rem(bound); let args: Vec<_> = [d0, d1, d2, d3] .into_iter() .map(MaybeRelocatable::from) diff --git a/vm/src/hint_processor/builtin_hint_processor/keccak_utils.rs b/vm/src/hint_processor/builtin_hint_processor/keccak_utils.rs index 8167908858..7d1fc8ce95 100644 --- a/vm/src/hint_processor/builtin_hint_processor/keccak_utils.rs +++ b/vm/src/hint_processor/builtin_hint_processor/keccak_utils.rs @@ -195,7 +195,7 @@ pub fn split_output( ) -> Result<(), HintError> { let output_name = format!("output{}", num); let output = get_integer_from_var_name(&output_name, vm, ids_data, ap_tracking)?; - let (high, low) = output.div_rem(&pow2_const_nz(128)); + let (high, low) = output.div_rem(pow2_const_nz(128)); insert_value_from_var_name( &format!("output{}_high", num), high, @@ -278,8 +278,8 @@ pub fn split_output_mid_low_high( ) -> Result<(), HintError> { let binding = get_integer_from_var_name("output1", vm, ids_data, ap_tracking)?; let output1 = binding.as_ref(); - let (tmp, output1_low) = output1.div_rem(&pow2_const_nz(8 * 7)); - let (output1_high, output1_mid) = tmp.div_rem(&pow2_const_nz(128)); + let (tmp, output1_low) = output1.div_rem(pow2_const_nz(8 * 7)); + let (output1_high, output1_mid) = tmp.div_rem(pow2_const_nz(128)); insert_value_from_var_name("output1_high", output1_high, vm, ids_data, ap_tracking)?; insert_value_from_var_name("output1_mid", output1_mid, vm, ids_data, ap_tracking)?; insert_value_from_var_name("output1_low", output1_low, vm, ids_data, ap_tracking) diff --git a/vm/src/hint_processor/builtin_hint_processor/uint384.rs b/vm/src/hint_processor/builtin_hint_processor/uint384.rs index 9d34881633..c7d6ba3465 100644 --- a/vm/src/hint_processor/builtin_hint_processor/uint384.rs +++ b/vm/src/hint_processor/builtin_hint_processor/uint384.rs @@ -83,7 +83,7 @@ pub fn uint384_split_128( ) -> Result<(), HintError> { let bound = pow2_const_nz(128); let a = get_integer_from_var_name("a", vm, ids_data, ap_tracking)?; - let (high, low) = a.div_rem(&bound); + let (high, low) = a.div_rem(bound); insert_value_from_var_name("low", low, vm, ids_data, ap_tracking)?; insert_value_from_var_name("high", high, vm, ids_data, ap_tracking) } diff --git a/vm/src/math_utils/mod.rs b/vm/src/math_utils/mod.rs index fbcbfa3bd1..521b226fae 100644 --- a/vm/src/math_utils/mod.rs +++ b/vm/src/math_utils/mod.rs @@ -18,7 +18,7 @@ use stark_felt::NonZeroFelt; lazy_static! { pub static ref SIGNED_FELT_MAX: BigUint = (&*CAIRO_PRIME).shr(1_u32); static ref POWERS_OF_TWO: Vec = - core::iter::successors(Some(Felt252::ONE), |x| Some(x * &Felt252::TWO)) + core::iter::successors(Some(Felt252::ONE), |x| Some(x * Felt252::TWO)) .take(252) .map(|x| x.try_into().unwrap()) .collect::>();