Skip to content

Commit

Permalink
fix: patch clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-camuto committed Sep 2, 2024
1 parent 70939f0 commit 50534f9
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion halo2_gadgets/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#![cfg_attr(docsrs, feature(doc_cfg))]
// Temporary until we have more of the crate implemented.
#![allow(dead_code)]
#![allow(dead_code, clippy::single_range_in_vec_init)]
// Catch documentation errors caused by code changes.
#![deny(rustdoc::broken_intra_doc_links)]
#![deny(missing_debug_implementations)]
Expand Down
1 change: 1 addition & 0 deletions halo2_proofs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ cost-estimator = ["serde_derive"]
derive_serde = ["halo2curves/derive_serde"]
parallel-poly-read = []
precompute-coset = []
multicore = []

[lib]
bench = false
Expand Down
2 changes: 1 addition & 1 deletion halo2_proofs/benches/fft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn criterion_benchmark(c: &mut Criterion) {

let omega = Fp::random(OsRng); // would be weird if this mattered
b.iter(|| {
best_fft(&mut a, omega, k as u32, domain.get_fft_data(l_a), false);
best_fft(&mut a, omega, k, domain.get_fft_data(l_a), false);
});
});
}
Expand Down
1 change: 1 addition & 0 deletions halo2_proofs/benches/plonk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use criterion::{BenchmarkId, Criterion};
fn criterion_benchmark(c: &mut Criterion) {
/// This represents an advice column at a certain row in the ConstraintSystem
#[derive(Copy, Clone, Debug)]
#[allow(dead_code)]
pub struct Variable(Column<Advice>, usize);

#[derive(Clone)]
Expand Down
1 change: 0 additions & 1 deletion halo2_proofs/examples/simple-lookup-unblinded.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#[macro_use]
extern crate criterion;

use ff::PrimeField;
Expand Down
1 change: 0 additions & 1 deletion halo2_proofs/examples/simple-lookup.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#[macro_use]
extern crate criterion;

use ff::PrimeField;
Expand Down
2 changes: 1 addition & 1 deletion halo2_proofs/src/fft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ mod tests {

let input = vec![Scalar::random(OsRng); n];

let num_threads = multicore::current_num_threads();
let _num_threads = multicore::current_num_threads();

let mut a = input.clone();
let l_a = a.len();
Expand Down
2 changes: 1 addition & 1 deletion halo2_proofs/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub trait SerdePrimeField: PrimeField + SerdeObject {

/// Writes a field element as bytes to the buffer according to the `format`:
/// - `Processed`: Writes a field element in standard form, with endianness specified by the
/// `PrimeField` implementation.
/// `PrimeField` implementation.
/// - Otherwise: Writes a field element into raw bytes in its internal Montgomery representation,
/// WITHOUT performing the expensive Montgomery reduction.
fn write<W: io::Write>(&self, writer: &mut W, format: SerdeFormat) -> io::Result<()> {
Expand Down
8 changes: 7 additions & 1 deletion halo2_proofs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

#![cfg_attr(docsrs, feature(doc_cfg))]
// The actual lints we want to disable.
#![allow(clippy::op_ref, clippy::many_single_char_names)]
#![allow(
clippy::op_ref,
clippy::many_single_char_names,
clippy::empty_docs,
clippy::doc_lazy_continuation,
clippy::single_range_in_vec_init
)]
#![deny(rustdoc::broken_intra_doc_links)]
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
Expand Down
8 changes: 4 additions & 4 deletions halo2_proofs/src/poly/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ impl<F: WithSmallOrderMulGroup<3>> EvaluationDomain<F> {
});
}

fn ifft(&self, a: &mut Vec<F>, omega_inv: F, log_n: u32, divisor: F) {
fn ifft(&self, a: &mut [F], omega_inv: F, log_n: u32, divisor: F) {
let fft_data = self.get_fft_data(a.len());
crate::fft::parallel::fft(a, omega_inv, log_n, fft_data, true);
// self.fft_inner(a, omega_inv, log_n, true);
Expand All @@ -609,7 +609,7 @@ impl<F: WithSmallOrderMulGroup<3>> EvaluationDomain<F> {
});
}

fn fft_inner(&self, a: &mut Vec<F>, omega: F, log_n: u32, inverse: bool) {
fn fft_inner(&self, a: &mut [F], omega: F, log_n: u32, inverse: bool) {
let fft_data = self.get_fft_data(a.len());
best_fft(a, omega, log_n, fft_data, inverse)
}
Expand Down Expand Up @@ -846,8 +846,8 @@ fn test_coeff_to_extended_part() {
#[test]
fn bench_coeff_to_extended_parts() {
use halo2curves::pasta::pallas::Scalar;
use rand_core::OsRng;
use instant::Instant;
use rand_core::OsRng;

let k = 20;
let domain = EvaluationDomain::<Scalar>::new(3, k);
Expand Down Expand Up @@ -934,8 +934,8 @@ fn test_lagrange_vecs_to_extended() {
#[test]
fn bench_lagrange_vecs_to_extended() {
use halo2curves::pasta::pallas::Scalar;
use rand_core::OsRng;
use instant::Instant;
use rand_core::OsRng;

let rng = OsRng;
let domain = EvaluationDomain::<Scalar>::new(8, 10);
Expand Down

0 comments on commit 50534f9

Please sign in to comment.