From 4839d07f3cc93b129f125c8714bac5a09c6be270 Mon Sep 17 00:00:00 2001 From: eigmax Date: Thu, 24 Jul 2025 15:36:15 +0800 Subject: [PATCH 1/5] fix clippy --- fields/src/packed.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fields/src/packed.rs b/fields/src/packed.rs index e4cebb2b..c5b00ded 100644 --- a/fields/src/packed.rs +++ b/fields/src/packed.rs @@ -70,7 +70,7 @@ where fn pack_slice(buf: &[Self::Scalar]) -> &[Self] { assert!( - buf.len() % Self::WIDTH == 0, + buf.len().is_multiple_of(Self::WIDTH), "Slice length (got {}) must be a multiple of packed field width ({}).", buf.len(), Self::WIDTH @@ -81,7 +81,7 @@ where } fn pack_slice_mut(buf: &mut [Self::Scalar]) -> &mut [Self] { assert!( - buf.len() % Self::WIDTH == 0, + buf.len().is_multiple_of(Self::WIDTH), "Slice length (got {}) must be a multiple of packed field width ({}).", buf.len(), Self::WIDTH From 1b31bd2e2c16692960e593f9c231cc5350fc8c7c Mon Sep 17 00:00:00 2001 From: eigmax Date: Thu, 24 Jul 2025 16:32:03 +0800 Subject: [PATCH 2/5] fix clippy --- starky/src/stark_gen.rs | 2 +- starky/src/starkinfo_cp_prover.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/starky/src/stark_gen.rs b/starky/src/stark_gen.rs index 61776f50..1e4c949b 100644 --- a/starky/src/stark_gen.rs +++ b/starky/src/stark_gen.rs @@ -776,7 +776,7 @@ pub fn calculate_exps( // N-next ~ N: c_last for i in 0..N { c_first.eval(ctx, i); - if (i % 10000) == 0 { + if i.is_multiple_of(10000) { log::trace!("Calculating expression.. {}/{}", i, N); } } diff --git a/starky/src/starkinfo_cp_prover.rs b/starky/src/starkinfo_cp_prover.rs index 3fdfb6ef..7149a766 100644 --- a/starky/src/starkinfo_cp_prover.rs +++ b/starky/src/starkinfo_cp_prover.rs @@ -152,12 +152,12 @@ fn _calculate_im_pols( } (im_e, md) } else if ["number", "public", "challenge"].contains(&exp.op.as_str()) { - return (im_expressions.clone(), 0); + (im_expressions.clone(), 0) } else if ["x", "const", "cm"].contains(&exp.op.as_str()) { if max_deg < 1 { return (None, -1); } - return (im_expressions.clone(), 1); + (im_expressions.clone(), 1) } else if exp.op.as_str() == "mul" { let mut eb: Option> = None; let mut ed = -1; @@ -192,11 +192,11 @@ fn _calculate_im_pols( let (e1, d1) = _calculate_im_pols(pil, &(values[0]), im_expressions, l, abs_max, abs_max_d); let (e2, d2) = _calculate_im_pols(pil, &(values[1]), &e1, r, abs_max, abs_max_d); - if e2.is_some() { + if let Some(ref e2_) = e2 { if eb.is_none() { eb = e2; ed = d1 + d2; - } else if e2.as_ref().unwrap().len() < eb.as_ref().unwrap().len() { + } else if e2_.len() < eb.as_ref().unwrap().len() { eb = e2; ed = d1 + d2; } @@ -208,7 +208,7 @@ fn _calculate_im_pols( return (eb, ed); } } - return (eb, ed); + (eb, ed) } else if exp.op.as_str() == "exp" { if max_deg < 1 { return (None, -1); @@ -231,9 +231,9 @@ fn _calculate_im_pols( if d > *abs_max_d { *abs_max_d = d; } - return (Some(e), 1); + (Some(e), 1) } else { - return (Some(e), d); + (Some(e), d) } } else { panic!("Exp op not defined: {}", exp.op); From 1ee6d2ea786871d2994814281ddba8963c0ccc25 Mon Sep 17 00:00:00 2001 From: eigmax Date: Thu, 24 Jul 2025 16:35:12 +0800 Subject: [PATCH 3/5] fix clippy --- algebraic/src/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algebraic/src/utils.rs b/algebraic/src/utils.rs index b8d3669b..68f99275 100644 --- a/algebraic/src/utils.rs +++ b/algebraic/src/utils.rs @@ -18,7 +18,7 @@ fn from_single_size_limb_witnesses( ) -> F { assert_eq!(params.num_limbs_for_in_field_representation, witnesses.len()); assert!( - params.binary_limbs_params.limb_size_bits % params.range_check_info.minimal_multiple == 0, + params.binary_limbs_params.limb_size_bits.is_multiple_of(params.range_check_info.minimal_multiple), "limb size must be divisible by range constraint strategy granularity" ); From 7d75c9f11a6ad1c212b1a8c83fcb08db40358eed Mon Sep 17 00:00:00 2001 From: eigmax Date: Thu, 24 Jul 2025 16:37:27 +0800 Subject: [PATCH 4/5] fix clippy --- algebraic/src/utils.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/algebraic/src/utils.rs b/algebraic/src/utils.rs index 68f99275..88971d36 100644 --- a/algebraic/src/utils.rs +++ b/algebraic/src/utils.rs @@ -18,7 +18,10 @@ fn from_single_size_limb_witnesses( ) -> F { assert_eq!(params.num_limbs_for_in_field_representation, witnesses.len()); assert!( - params.binary_limbs_params.limb_size_bits.is_multiple_of(params.range_check_info.minimal_multiple), + params + .binary_limbs_params + .limb_size_bits + .is_multiple_of(params.range_check_info.minimal_multiple), "limb size must be divisible by range constraint strategy granularity" ); From bc1b3f27b2134bf817c51c29850fa49da222e0c6 Mon Sep 17 00:00:00 2001 From: eigmax Date: Thu, 24 Jul 2025 16:38:22 +0800 Subject: [PATCH 5/5] fix clippy --- .github/workflows/ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 524fca83..a80aa6dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,14 +23,6 @@ jobs: - nightly steps: - uses: actions/checkout@v2 - - name: Install Rust toolchain 1.75 - run: rustup toolchain install 1.75.0-x86_64-unknown-linux-gnu - - name: Install nightly - run: rustup toolchain install nightly-2024-02-01-x86_64-unknown-linux-gnu - - name: Install std source - run: rustup component add rust-src --toolchain nightly-2024-02-01-x86_64-unknown-linux-gnu - - name: Install riscv target - run: rustup target add riscv32imac-unknown-none-elf --toolchain nightly-2024-02-01-x86_64-unknown-linux-gnu - name: Install test dependencies run: sudo apt-get update && sudo apt-get install -y binutils-riscv64-unknown-elf lld - name: Run tests