clippy: Fix capitalized acronyms in tests and examples

This commit is contained in:
Jack Grigg 2021-06-23 13:33:04 +01:00
parent 305ca89bab
commit e262941b70
3 changed files with 39 additions and 39 deletions

View File

@ -22,7 +22,7 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) {
let params: Params<EqAffine> = Params::new(k); let params: Params<EqAffine> = Params::new(k);
#[derive(Clone)] #[derive(Clone)]
struct PLONKConfig { struct PlonkConfig {
a: Column<Advice>, a: Column<Advice>,
b: Column<Advice>, b: Column<Advice>,
c: Column<Advice>, c: Column<Advice>,
@ -35,7 +35,7 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) {
perm: Permutation, perm: Permutation,
} }
trait StandardCS<FF: FieldExt> { trait StandardCs<FF: FieldExt> {
fn raw_multiply<F>( fn raw_multiply<F>(
&self, &self,
layouter: &mut impl Layouter<FF>, layouter: &mut impl Layouter<FF>,
@ -59,21 +59,21 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) {
k: u32, k: u32,
} }
struct StandardPLONK<F: FieldExt> { struct StandardPlonk<F: FieldExt> {
config: PLONKConfig, config: PlonkConfig,
_marker: PhantomData<F>, _marker: PhantomData<F>,
} }
impl<FF: FieldExt> StandardPLONK<FF> { impl<FF: FieldExt> StandardPlonk<FF> {
fn new(config: PLONKConfig) -> Self { fn new(config: PlonkConfig) -> Self {
StandardPLONK { StandardPlonk {
config, config,
_marker: PhantomData, _marker: PhantomData,
} }
} }
} }
impl<FF: FieldExt> StandardCS<FF> for StandardPLONK<FF> { impl<FF: FieldExt> StandardCs<FF> for StandardPlonk<FF> {
fn raw_multiply<F>( fn raw_multiply<F>(
&self, &self,
layouter: &mut impl Layouter<FF>, layouter: &mut impl Layouter<FF>,
@ -172,14 +172,14 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) {
} }
impl<F: FieldExt> Circuit<F> for MyCircuit<F> { impl<F: FieldExt> Circuit<F> for MyCircuit<F> {
type Config = PLONKConfig; type Config = PlonkConfig;
type FloorPlanner = SimpleFloorPlanner; type FloorPlanner = SimpleFloorPlanner;
fn without_witnesses(&self) -> Self { fn without_witnesses(&self) -> Self {
Self { a: None, k: self.k } Self { a: None, k: self.k }
} }
fn configure(meta: &mut ConstraintSystem<F>) -> PLONKConfig { fn configure(meta: &mut ConstraintSystem<F>) -> PlonkConfig {
let a = meta.advice_column(); let a = meta.advice_column();
let b = meta.advice_column(); let b = meta.advice_column();
let c = meta.advice_column(); let c = meta.advice_column();
@ -204,7 +204,7 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) {
vec![a.clone() * sa + b.clone() * sb + a * b * sm + (c * sc * (-F::one()))] vec![a.clone() * sa + b.clone() * sb + a * b * sm + (c * sc * (-F::one()))]
}); });
PLONKConfig { PlonkConfig {
a, a,
b, b,
c, c,
@ -218,10 +218,10 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) {
fn synthesize( fn synthesize(
&self, &self,
config: PLONKConfig, config: PlonkConfig,
mut layouter: impl Layouter<F>, mut layouter: impl Layouter<F>,
) -> Result<(), Error> { ) -> Result<(), Error> {
let cs = StandardPLONK::new(config); let cs = StandardPlonk::new(config);
for _ in 0..(1 << (self.k - 1)) { for _ in 0..(1 << (self.k - 1)) {
let mut a_squared = None; let mut a_squared = None;

View File

@ -16,7 +16,7 @@ fn main() {
pub struct Variable(Column<Advice>, usize); pub struct Variable(Column<Advice>, usize);
#[derive(Clone)] #[derive(Clone)]
struct PLONKConfig { struct PlonkConfig {
a: Column<Advice>, a: Column<Advice>,
b: Column<Advice>, b: Column<Advice>,
c: Column<Advice>, c: Column<Advice>,
@ -35,7 +35,7 @@ fn main() {
perm2: Permutation, perm2: Permutation,
} }
trait StandardCS<FF: FieldExt> { trait StandardCs<FF: FieldExt> {
fn raw_multiply<F>( fn raw_multiply<F>(
&self, &self,
region: &mut Region<FF>, region: &mut Region<FF>,
@ -62,21 +62,21 @@ fn main() {
lookup_tables: Vec<Vec<F>>, lookup_tables: Vec<Vec<F>>,
} }
struct StandardPLONK<F: FieldExt> { struct StandardPlonk<F: FieldExt> {
config: PLONKConfig, config: PlonkConfig,
_marker: PhantomData<F>, _marker: PhantomData<F>,
} }
impl<FF: FieldExt> StandardPLONK<FF> { impl<FF: FieldExt> StandardPlonk<FF> {
fn new(config: PLONKConfig) -> Self { fn new(config: PlonkConfig) -> Self {
StandardPLONK { StandardPlonk {
config, config,
_marker: PhantomData, _marker: PhantomData,
} }
} }
} }
impl<FF: FieldExt> StandardCS<FF> for StandardPLONK<FF> { impl<FF: FieldExt> StandardCs<FF> for StandardPlonk<FF> {
fn raw_multiply<F>( fn raw_multiply<F>(
&self, &self,
region: &mut Region<FF>, region: &mut Region<FF>,
@ -221,7 +221,7 @@ fn main() {
} }
impl<F: FieldExt> Circuit<F> for MyCircuit<F> { impl<F: FieldExt> Circuit<F> for MyCircuit<F> {
type Config = PLONKConfig; type Config = PlonkConfig;
type FloorPlanner = SimpleFloorPlanner; type FloorPlanner = SimpleFloorPlanner;
fn without_witnesses(&self) -> Self { fn without_witnesses(&self) -> Self {
@ -231,7 +231,7 @@ fn main() {
} }
} }
fn configure(meta: &mut ConstraintSystem<F>) -> PLONKConfig { fn configure(meta: &mut ConstraintSystem<F>) -> PlonkConfig {
let e = meta.advice_column(); let e = meta.advice_column();
let a = meta.advice_column(); let a = meta.advice_column();
let b = meta.advice_column(); let b = meta.advice_column();
@ -309,7 +309,7 @@ fn main() {
vec![sp * (a + p * (-F::one()))] vec![sp * (a + p * (-F::one()))]
}); });
PLONKConfig { PlonkConfig {
a, a,
b, b,
c, c,
@ -329,10 +329,10 @@ fn main() {
fn synthesize( fn synthesize(
&self, &self,
config: PLONKConfig, config: PlonkConfig,
mut layouter: impl Layouter<F>, mut layouter: impl Layouter<F>,
) -> Result<(), Error> { ) -> Result<(), Error> {
let cs = StandardPLONK::new(config); let cs = StandardPlonk::new(config);
let _ = cs.public_input(&mut layouter.namespace(|| "input"), || { let _ = cs.public_input(&mut layouter.namespace(|| "input"), || {
Ok(F::one() + F::one()) Ok(F::one() + F::one())

View File

@ -29,7 +29,7 @@ fn plonk_api() {
let params: Params<EqAffine> = Params::new(K); let params: Params<EqAffine> = Params::new(K);
#[derive(Clone)] #[derive(Clone)]
struct PLONKConfig { struct PlonkConfig {
a: Column<Advice>, a: Column<Advice>,
b: Column<Advice>, b: Column<Advice>,
c: Column<Advice>, c: Column<Advice>,
@ -48,7 +48,7 @@ fn plonk_api() {
perm2: Permutation, perm2: Permutation,
} }
trait StandardCS<FF: FieldExt> { trait StandardCs<FF: FieldExt> {
fn raw_multiply<F>( fn raw_multiply<F>(
&self, &self,
layouter: &mut impl Layouter<FF>, layouter: &mut impl Layouter<FF>,
@ -80,21 +80,21 @@ fn plonk_api() {
lookup_tables: Vec<Vec<F>>, lookup_tables: Vec<Vec<F>>,
} }
struct StandardPLONK<F: FieldExt> { struct StandardPlonk<F: FieldExt> {
config: PLONKConfig, config: PlonkConfig,
_marker: PhantomData<F>, _marker: PhantomData<F>,
} }
impl<FF: FieldExt> StandardPLONK<FF> { impl<FF: FieldExt> StandardPlonk<FF> {
fn new(config: PLONKConfig) -> Self { fn new(config: PlonkConfig) -> Self {
StandardPLONK { StandardPlonk {
config, config,
_marker: PhantomData, _marker: PhantomData,
} }
} }
} }
impl<FF: FieldExt> StandardCS<FF> for StandardPLONK<FF> { impl<FF: FieldExt> StandardCs<FF> for StandardPlonk<FF> {
fn raw_multiply<F>( fn raw_multiply<F>(
&self, &self,
layouter: &mut impl Layouter<FF>, layouter: &mut impl Layouter<FF>,
@ -263,7 +263,7 @@ fn plonk_api() {
} }
impl<F: FieldExt> Circuit<F> for MyCircuit<F> { impl<F: FieldExt> Circuit<F> for MyCircuit<F> {
type Config = PLONKConfig; type Config = PlonkConfig;
type FloorPlanner = SimpleFloorPlanner; type FloorPlanner = SimpleFloorPlanner;
fn without_witnesses(&self) -> Self { fn without_witnesses(&self) -> Self {
@ -273,7 +273,7 @@ fn plonk_api() {
} }
} }
fn configure(meta: &mut ConstraintSystem<F>) -> PLONKConfig { fn configure(meta: &mut ConstraintSystem<F>) -> PlonkConfig {
let e = meta.advice_column(); let e = meta.advice_column();
let a = meta.advice_column(); let a = meta.advice_column();
let b = meta.advice_column(); let b = meta.advice_column();
@ -351,7 +351,7 @@ fn plonk_api() {
vec![sp * (a + p * (-F::one()))] vec![sp * (a + p * (-F::one()))]
}); });
PLONKConfig { PlonkConfig {
a, a,
b, b,
c, c,
@ -371,10 +371,10 @@ fn plonk_api() {
fn synthesize( fn synthesize(
&self, &self,
config: PLONKConfig, config: PlonkConfig,
mut layouter: impl Layouter<F>, mut layouter: impl Layouter<F>,
) -> Result<(), Error> { ) -> Result<(), Error> {
let cs = StandardPLONK::new(config); let cs = StandardPlonk::new(config);
let _ = cs.public_input(&mut layouter, || Ok(F::one() + F::one()))?; let _ = cs.public_input(&mut layouter, || Ok(F::one() + F::one()))?;