Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Oppen committed Oct 30, 2023
1 parent f27dc43 commit 3edc567
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions vm/src/hint_processor/builtin_hint_processor/keccak_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion vm/src/hint_processor/builtin_hint_processor/uint384.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion vm/src/math_utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<NonZeroFelt> =
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::<Vec<_>>();
Expand Down

0 comments on commit 3edc567

Please sign in to comment.