From e262941b7079dba4c916739e919f1b8558f919a9 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Wed, 23 Jun 2021 13:33:04 +0100 Subject: [PATCH] clippy: Fix capitalized acronyms in tests and examples --- benches/plonk.rs | 26 +++++++++++++------------- examples/circuit-layout.rs | 26 +++++++++++++------------- tests/plonk_api.rs | 26 +++++++++++++------------- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/benches/plonk.rs b/benches/plonk.rs index c27a75d1..7c048a37 100644 --- a/benches/plonk.rs +++ b/benches/plonk.rs @@ -22,7 +22,7 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) { let params: Params = Params::new(k); #[derive(Clone)] - struct PLONKConfig { + struct PlonkConfig { a: Column, b: Column, c: Column, @@ -35,7 +35,7 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) { perm: Permutation, } - trait StandardCS { + trait StandardCs { fn raw_multiply( &self, layouter: &mut impl Layouter, @@ -59,21 +59,21 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) { k: u32, } - struct StandardPLONK { - config: PLONKConfig, + struct StandardPlonk { + config: PlonkConfig, _marker: PhantomData, } - impl StandardPLONK { - fn new(config: PLONKConfig) -> Self { - StandardPLONK { + impl StandardPlonk { + fn new(config: PlonkConfig) -> Self { + StandardPlonk { config, _marker: PhantomData, } } } - impl StandardCS for StandardPLONK { + impl StandardCs for StandardPlonk { fn raw_multiply( &self, layouter: &mut impl Layouter, @@ -172,14 +172,14 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) { } impl Circuit for MyCircuit { - type Config = PLONKConfig; + type Config = PlonkConfig; type FloorPlanner = SimpleFloorPlanner; fn without_witnesses(&self) -> Self { Self { a: None, k: self.k } } - fn configure(meta: &mut ConstraintSystem) -> PLONKConfig { + fn configure(meta: &mut ConstraintSystem) -> PlonkConfig { let a = meta.advice_column(); let b = 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()))] }); - PLONKConfig { + PlonkConfig { a, b, c, @@ -218,10 +218,10 @@ fn bench_with_k(name: &str, k: u32, c: &mut Criterion) { fn synthesize( &self, - config: PLONKConfig, + config: PlonkConfig, mut layouter: impl Layouter, ) -> Result<(), Error> { - let cs = StandardPLONK::new(config); + let cs = StandardPlonk::new(config); for _ in 0..(1 << (self.k - 1)) { let mut a_squared = None; diff --git a/examples/circuit-layout.rs b/examples/circuit-layout.rs index d54fe0ce..e1b77985 100644 --- a/examples/circuit-layout.rs +++ b/examples/circuit-layout.rs @@ -16,7 +16,7 @@ fn main() { pub struct Variable(Column, usize); #[derive(Clone)] - struct PLONKConfig { + struct PlonkConfig { a: Column, b: Column, c: Column, @@ -35,7 +35,7 @@ fn main() { perm2: Permutation, } - trait StandardCS { + trait StandardCs { fn raw_multiply( &self, region: &mut Region, @@ -62,21 +62,21 @@ fn main() { lookup_tables: Vec>, } - struct StandardPLONK { - config: PLONKConfig, + struct StandardPlonk { + config: PlonkConfig, _marker: PhantomData, } - impl StandardPLONK { - fn new(config: PLONKConfig) -> Self { - StandardPLONK { + impl StandardPlonk { + fn new(config: PlonkConfig) -> Self { + StandardPlonk { config, _marker: PhantomData, } } } - impl StandardCS for StandardPLONK { + impl StandardCs for StandardPlonk { fn raw_multiply( &self, region: &mut Region, @@ -221,7 +221,7 @@ fn main() { } impl Circuit for MyCircuit { - type Config = PLONKConfig; + type Config = PlonkConfig; type FloorPlanner = SimpleFloorPlanner; fn without_witnesses(&self) -> Self { @@ -231,7 +231,7 @@ fn main() { } } - fn configure(meta: &mut ConstraintSystem) -> PLONKConfig { + fn configure(meta: &mut ConstraintSystem) -> PlonkConfig { let e = meta.advice_column(); let a = meta.advice_column(); let b = meta.advice_column(); @@ -309,7 +309,7 @@ fn main() { vec![sp * (a + p * (-F::one()))] }); - PLONKConfig { + PlonkConfig { a, b, c, @@ -329,10 +329,10 @@ fn main() { fn synthesize( &self, - config: PLONKConfig, + config: PlonkConfig, mut layouter: impl Layouter, ) -> Result<(), Error> { - let cs = StandardPLONK::new(config); + let cs = StandardPlonk::new(config); let _ = cs.public_input(&mut layouter.namespace(|| "input"), || { Ok(F::one() + F::one()) diff --git a/tests/plonk_api.rs b/tests/plonk_api.rs index 4955ea23..c6f0b807 100644 --- a/tests/plonk_api.rs +++ b/tests/plonk_api.rs @@ -29,7 +29,7 @@ fn plonk_api() { let params: Params = Params::new(K); #[derive(Clone)] - struct PLONKConfig { + struct PlonkConfig { a: Column, b: Column, c: Column, @@ -48,7 +48,7 @@ fn plonk_api() { perm2: Permutation, } - trait StandardCS { + trait StandardCs { fn raw_multiply( &self, layouter: &mut impl Layouter, @@ -80,21 +80,21 @@ fn plonk_api() { lookup_tables: Vec>, } - struct StandardPLONK { - config: PLONKConfig, + struct StandardPlonk { + config: PlonkConfig, _marker: PhantomData, } - impl StandardPLONK { - fn new(config: PLONKConfig) -> Self { - StandardPLONK { + impl StandardPlonk { + fn new(config: PlonkConfig) -> Self { + StandardPlonk { config, _marker: PhantomData, } } } - impl StandardCS for StandardPLONK { + impl StandardCs for StandardPlonk { fn raw_multiply( &self, layouter: &mut impl Layouter, @@ -263,7 +263,7 @@ fn plonk_api() { } impl Circuit for MyCircuit { - type Config = PLONKConfig; + type Config = PlonkConfig; type FloorPlanner = SimpleFloorPlanner; fn without_witnesses(&self) -> Self { @@ -273,7 +273,7 @@ fn plonk_api() { } } - fn configure(meta: &mut ConstraintSystem) -> PLONKConfig { + fn configure(meta: &mut ConstraintSystem) -> PlonkConfig { let e = meta.advice_column(); let a = meta.advice_column(); let b = meta.advice_column(); @@ -351,7 +351,7 @@ fn plonk_api() { vec![sp * (a + p * (-F::one()))] }); - PLONKConfig { + PlonkConfig { a, b, c, @@ -371,10 +371,10 @@ fn plonk_api() { fn synthesize( &self, - config: PLONKConfig, + config: PlonkConfig, mut layouter: impl Layouter, ) -> Result<(), Error> { - let cs = StandardPLONK::new(config); + let cs = StandardPlonk::new(config); let _ = cs.public_input(&mut layouter, || Ok(F::one() + F::one()))?;