Skip to content

Commit

Permalink
bus-auto: fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurélien Nicolas committed Nov 15, 2023
1 parent 3ef65de commit 8fc9156
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 8 deletions.
4 changes: 2 additions & 2 deletions halo2_proofs/src/circuit/layouter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,11 @@ impl<F: Field> RegionLayouter<F> for RegionShape {
Ok(())
}

fn query_advice(&self, column: Column<Advice>, offset: usize) -> Result<F, Error> {
fn query_advice(&self, _column: Column<Advice>, _offset: usize) -> Result<F, Error> {
Ok(F::zero())
}

fn query_fixed(&self, column: Column<Fixed>, offset: usize) -> Result<F, Error> {
fn query_fixed(&self, _column: Column<Fixed>, _offset: usize) -> Result<F, Error> {
Ok(F::zero())
}

Expand Down
4 changes: 2 additions & 2 deletions halo2_proofs/src/dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ impl<'a, F: Field + Group> Assignment<F> for MockProver<'a, F> {
.map(|v| match v {
CellValue::Assigned(f) => *f,
#[cfg(feature = "mock-batch-inv")]
CellValue::Rational(n, d) => n * d.invert().unwrap_or_default(),
CellValue::Rational(n, d) => *n * d.invert().unwrap_or(F::zero()),
_ => F::zero(),
})
.ok_or(Error::BoundsFailure)
Expand All @@ -695,7 +695,7 @@ impl<'a, F: Field + Group> Assignment<F> for MockProver<'a, F> {
.map(|v| match v {
CellValue::Assigned(f) => *f,
#[cfg(feature = "mock-batch-inv")]
CellValue::Rational(n, d) => n * d.invert().unwrap_or_default(),
CellValue::Rational(n, d) => *n * d.invert().unwrap_or(F::zero()),
_ => F::zero(),
})
.ok_or(Error::BoundsFailure)
Expand Down
4 changes: 2 additions & 2 deletions halo2_proofs/src/dev/cost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ impl<F: Field> Assignment<F> for Assembly {
todo!()
}

fn query_advice(&self, column: Column<Advice>, row: usize) -> Result<F, Error> {
fn query_advice(&self, _column: Column<Advice>, _row: usize) -> Result<F, Error> {
Ok(F::zero())
}

fn query_fixed(&self, column: Column<Fixed>, row: usize) -> Result<F, Error> {
fn query_fixed(&self, _column: Column<Fixed>, _row: usize) -> Result<F, Error> {
Ok(F::zero())
}

Expand Down
8 changes: 8 additions & 0 deletions halo2_proofs/src/dev/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ impl<F: Field> Assignment<F> for Graph {
// Do nothing
}

fn query_advice(&self, _column: Column<Advice>, _row: usize) -> Result<F, Error> {
Ok(F::zero())
}

fn query_fixed(&self, _column: Column<Fixed>, _row: usize) -> Result<F, Error> {
Ok(F::zero())
}

fn query_instance(&self, _: Column<Instance>, _: usize) -> Result<Value<F>, Error> {
Ok(Value::unknown())
}
Expand Down
8 changes: 8 additions & 0 deletions halo2_proofs/src/dev/graph/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,14 @@ impl<F: Field> Assignment<F> for Layout {
todo!()
}

fn query_advice(&self, _column: Column<Advice>, _row: usize) -> Result<F, Error> {
Ok(F::zero())
}

fn query_fixed(&self, _column: Column<Fixed>, _row: usize) -> Result<F, Error> {
Ok(F::zero())
}

fn query_instance(&self, _: Column<Instance>, _: usize) -> Result<Value<F>, Error> {
Ok(Value::unknown())
}
Expand Down
4 changes: 2 additions & 2 deletions halo2_proofs/src/plonk/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ pub fn create_proof<
advice,
challenges: self.challenges,
instances: self.instances,
fixed_values: self.fixed_values.clone(),
fixed_values: self.fixed_values,
rw_rows: sub_range.clone(),
usable_rows: self.usable_rows,
_marker: Default::default(),
Expand Down Expand Up @@ -272,7 +272,7 @@ pub fn create_proof<
self.fixed_values
.get(column.index())
.and_then(|v| v.get(row))
.map(|v| *v)
.copied()
.ok_or(Error::BoundsFailure)
}

Expand Down

0 comments on commit 8fc9156

Please sign in to comment.