diff --git a/halo2_gadgets_optimized/src/ecc.rs b/halo2_gadgets_optimized/src/ecc.rs index 87af93d505..4861a20e52 100644 --- a/halo2_gadgets_optimized/src/ecc.rs +++ b/halo2_gadgets_optimized/src/ecc.rs @@ -14,7 +14,7 @@ pub mod chip; /// The set of circuit instructions required to use the ECC gadgets. pub trait EccInstructions: -Chip + UtilitiesInstructions + Clone + Debug + Eq + Chip + UtilitiesInstructions + Clone + Debug + Eq { /// Variable representing a scalar used in variable-base scalar mul. /// @@ -380,7 +380,7 @@ impl> NonIdentityPoint { } impl + Clone + Debug + Eq> -From> for Point + From> for Point { fn from(non_id_point: NonIdentityPoint) -> Self { Self { @@ -866,7 +866,7 @@ pub(crate) mod tests { layouter.namespace(|| "identity"), Value::known(pallas::Affine::identity()), ) - .expect_err("Trying to witness the identity should return an error"); + .expect_err("Trying to witness the identity should return an error"); } // Test witness non-identity point @@ -972,4 +972,4 @@ pub(crate) mod tests { .render(13, &circuit, &root) .unwrap(); } -} \ No newline at end of file +} diff --git a/halo2_gadgets_optimized/src/ecc/chip.rs b/halo2_gadgets_optimized/src/ecc/chip.rs index 8036b08338..402020384b 100644 --- a/halo2_gadgets_optimized/src/ecc/chip.rs +++ b/halo2_gadgets_optimized/src/ecc/chip.rs @@ -245,7 +245,7 @@ impl> Chip for Ecc } impl> UtilitiesInstructions -for EccChip + for EccChip { type Var = AssignedCell; } @@ -360,7 +360,7 @@ pub struct EccScalarFixedShort { /// The circuit-assigned running sum constraining this signed short scalar, or `None` /// if the scalar has not been used yet. running_sum: - Option, { NUM_WINDOWS_SHORT + 1 }>>, + Option, { NUM_WINDOWS_SHORT + 1 }>>, } /// A base field element used for fixed-base scalar multiplication. @@ -408,12 +408,12 @@ pub enum ScalarVar { } impl> EccInstructions for EccChip - where - >::Base: +where + >::Base: FixedPoint, - >::FullScalar: + >::FullScalar: FixedPoint, - >::ShortScalar: + >::ShortScalar: FixedPoint, { type ScalarFixed = EccScalarFixed; @@ -625,13 +625,13 @@ impl> EccInstructions for Ecc } impl> BaseFitsInScalarInstructions -for EccChip - where - >::Base: + for EccChip +where + >::Base: FixedPoint, - >::FullScalar: + >::FullScalar: FixedPoint, - >::ShortScalar: + >::ShortScalar: FixedPoint, { fn scalar_var_from_base( @@ -641,4 +641,4 @@ for EccChip ) -> Result { Ok(ScalarVar::BaseFieldElem(base.clone())) } -} \ No newline at end of file +} diff --git a/halo2_gadgets_optimized/src/ecc/chip/mul_fixed/short.rs b/halo2_gadgets_optimized/src/ecc/chip/mul_fixed/short.rs index 09a2a8d6df..a10c54c1ed 100644 --- a/halo2_gadgets_optimized/src/ecc/chip/mul_fixed/short.rs +++ b/halo2_gadgets_optimized/src/ecc/chip/mul_fixed/short.rs @@ -111,8 +111,8 @@ impl> Config { scalar: &EccScalarFixedShort, base: &>::ShortScalar, ) -> Result<(EccPoint, EccScalarFixedShort), Error> - where - >::ShortScalar: + where + >::ShortScalar: super::super::FixedPoint, { let (scalar, acc, mul_b) = layouter.assign_region( @@ -944,4 +944,4 @@ pub mod tests { ]) ); } -} \ No newline at end of file +} diff --git a/halo2_gadgets_optimized/src/ecc/chip/witness_point.rs b/halo2_gadgets_optimized/src/ecc/chip/witness_point.rs index bb21bbb511..98f865a6dc 100644 --- a/halo2_gadgets_optimized/src/ecc/chip/witness_point.rs +++ b/halo2_gadgets_optimized/src/ecc/chip/witness_point.rs @@ -206,6 +206,6 @@ pub mod tests { layouter.namespace(|| "witness identity"), Value::known(pallas::Affine::identity()), ) - .expect_err("witnessing 𝒪 should return an error"); + .expect_err("witnessing 𝒪 should return an error"); } -} \ No newline at end of file +} diff --git a/halo2_gadgets_optimized/src/sinsemilla.rs b/halo2_gadgets_optimized/src/sinsemilla.rs index c5b90441c6..2b04781613 100644 --- a/halo2_gadgets_optimized/src/sinsemilla.rs +++ b/halo2_gadgets_optimized/src/sinsemilla.rs @@ -113,17 +113,17 @@ pub trait SinsemillaInstructions - where - SinsemillaChip: SinsemillaInstructions + Clone + Debug + Eq, +where + SinsemillaChip: SinsemillaInstructions + Clone + Debug + Eq, { chip: SinsemillaChip, inner: SinsemillaChip::Message, } impl -Message - where - SinsemillaChip: SinsemillaInstructions + Clone + Debug + Eq, + Message +where + SinsemillaChip: SinsemillaInstructions + Clone + Debug + Eq, { #![allow(dead_code)] fn from_bitstring( @@ -177,16 +177,16 @@ Message /// A message piece with a bitlength of some multiple of `K`. #[derive(Copy, Clone, Debug)] pub struct MessagePiece - where - SinsemillaChip: SinsemillaInstructions + Clone + Debug + Eq, +where + SinsemillaChip: SinsemillaInstructions + Clone + Debug + Eq, { inner: SinsemillaChip::MessagePiece, } impl -MessagePiece - where - SinsemillaChip: SinsemillaInstructions + Clone + Debug + Eq, + MessagePiece +where + SinsemillaChip: SinsemillaInstructions + Clone + Debug + Eq, { /// Returns the inner MessagePiece contained in this gadget. pub fn inner(&self) -> SinsemillaChip::MessagePiece { @@ -195,9 +195,9 @@ MessagePiece } impl -MessagePiece - where - SinsemillaChip: SinsemillaInstructions + Clone + Debug + Eq, + MessagePiece +where + SinsemillaChip: SinsemillaInstructions + Clone + Debug + Eq, { #![allow(dead_code)] fn from_bitstring( @@ -375,7 +375,7 @@ HashDomain /// Trait allowing circuit's Sinsemilla CommitDomains to be enumerated. pub trait CommitDomains, H: HashDomains>: -Clone + Debug + Clone + Debug { /// Returns the fixed point corresponding to the R constant used for /// randomization in this CommitDomain. @@ -846,4 +846,4 @@ pub(crate) mod tests { .render(11, &circuit, &root) .unwrap(); } -} \ No newline at end of file +} diff --git a/halo2_gadgets_optimized/src/sinsemilla/chip.rs b/halo2_gadgets_optimized/src/sinsemilla/chip.rs index 75bbaf7014..c55efd1105 100644 --- a/halo2_gadgets_optimized/src/sinsemilla/chip.rs +++ b/halo2_gadgets_optimized/src/sinsemilla/chip.rs @@ -31,10 +31,10 @@ mod hash_to_point; /// Configuration for the Sinsemilla hash chip #[derive(Eq, PartialEq, Clone, Debug)] pub struct SinsemillaConfig - where - Hash: HashDomains, - F: FixedPoints, - Commit: CommitDomains, +where + Hash: HashDomains, + F: FixedPoints, + Commit: CommitDomains, { /// Binary selector used in lookup argument and in the body of the Sinsemilla hash. q_sinsemilla1: Selector, @@ -63,10 +63,10 @@ pub struct SinsemillaConfig } impl SinsemillaConfig - where - Hash: HashDomains, - F: FixedPoints, - Commit: CommitDomains, +where + Hash: HashDomains, + F: FixedPoints, + Commit: CommitDomains, { /// Returns an array of all advice columns in this config, in arbitrary order. pub(super) fn advices(&self) -> [Column; 5] { @@ -97,19 +97,19 @@ impl SinsemillaConfig /// [Chip description](https://zcash.github.io/halo2/design/gadgets/sinsemilla.html#plonk--halo-2-constraints). #[derive(Eq, PartialEq, Clone, Debug)] pub struct SinsemillaChip - where - Hash: HashDomains, - Fixed: FixedPoints, - Commit: CommitDomains, +where + Hash: HashDomains, + Fixed: FixedPoints, + Commit: CommitDomains, { config: SinsemillaConfig, } impl Chip for SinsemillaChip - where - Hash: HashDomains, - Fixed: FixedPoints, - Commit: CommitDomains, +where + Hash: HashDomains, + Fixed: FixedPoints, + Commit: CommitDomains, { type Config = SinsemillaConfig; type Loaded = (); @@ -124,10 +124,10 @@ impl Chip for SinsemillaChip SinsemillaChip - where - Hash: HashDomains, - F: FixedPoints, - Commit: CommitDomains, +where + Hash: HashDomains, + F: FixedPoints, + Commit: CommitDomains, { /// Reconstructs this chip from the given config. pub fn construct(config: >::Config) -> Self { @@ -266,11 +266,11 @@ impl SinsemillaChip // Implement `SinsemillaInstructions` for `SinsemillaChip` impl SinsemillaInstructions -for SinsemillaChip - where - Hash: HashDomains, - F: FixedPoints, - Commit: CommitDomains, + for SinsemillaChip +where + Hash: HashDomains, + F: FixedPoints, + Commit: CommitDomains, { type CellValue = AssignedCell; @@ -339,4 +339,4 @@ for SinsemillaChip fn extract(point: &Self::NonIdentityPoint) -> Self::X { point.x() } -} \ No newline at end of file +} diff --git a/halo2_gadgets_optimized/src/sinsemilla/chip/generator_table.rs b/halo2_gadgets_optimized/src/sinsemilla/chip/generator_table.rs index 8c75830f38..e77928b128 100644 --- a/halo2_gadgets_optimized/src/sinsemilla/chip/generator_table.rs +++ b/halo2_gadgets_optimized/src/sinsemilla/chip/generator_table.rs @@ -172,4 +172,4 @@ impl GeneratorTableConfig { }, ) } -} \ No newline at end of file +} diff --git a/halo2_gadgets_optimized/src/sinsemilla/chip/hash_to_point.rs b/halo2_gadgets_optimized/src/sinsemilla/chip/hash_to_point.rs index 15a8600a5b..165615efaa 100644 --- a/halo2_gadgets_optimized/src/sinsemilla/chip/hash_to_point.rs +++ b/halo2_gadgets_optimized/src/sinsemilla/chip/hash_to_point.rs @@ -17,10 +17,10 @@ use pasta_curves::{arithmetic::CurveAffine, pallas}; use std::ops::Deref; impl SinsemillaChip - where - Hash: HashDomains, - Fixed: FixedPoints, - Commit: CommitDomains, +where + Hash: HashDomains, + Fixed: FixedPoints, + Commit: CommitDomains, { /// [Specification](https://p.z.cash/halo2-0.1:sinsemilla-constraints?partial). #[allow(non_snake_case)] @@ -569,4 +569,4 @@ impl Deref for Y { fn deref(&self) -> &Value> { &self.0 } -} \ No newline at end of file +} diff --git a/halo2_gadgets_optimized/src/sinsemilla/merkle.rs b/halo2_gadgets_optimized/src/sinsemilla/merkle.rs index 998335785a..1eabfaa870 100644 --- a/halo2_gadgets_optimized/src/sinsemilla/merkle.rs +++ b/halo2_gadgets_optimized/src/sinsemilla/merkle.rs @@ -24,10 +24,10 @@ pub trait MerkleInstructions< const K: usize, const MAX_WORDS: usize, >: -SinsemillaInstructions -+ CondSwapInstructions -+ UtilitiesInstructions -+ Chip + SinsemillaInstructions + + CondSwapInstructions + + UtilitiesInstructions + + Chip { /// Compute MerkleCRH for a given `layer`. The hash that computes the root /// is at layer 0, and the hashes that are applied to two leaves are at @@ -64,15 +64,15 @@ pub struct MerklePath< } impl< - C: CurveAffine, - MerkleChip, - const PATH_LENGTH: usize, - const K: usize, - const MAX_WORDS: usize, - const PAR: usize, -> MerklePath - where - MerkleChip: MerkleInstructions + Clone, + C: CurveAffine, + MerkleChip, + const PATH_LENGTH: usize, + const K: usize, + const MAX_WORDS: usize, + const PAR: usize, + > MerklePath +where + MerkleChip: MerkleInstructions + Clone, { /// Constructs a [`MerklePath`]. /// @@ -99,15 +99,15 @@ impl< #[allow(non_snake_case)] impl< - C: CurveAffine, - MerkleChip, - const PATH_LENGTH: usize, - const K: usize, - const MAX_WORDS: usize, - const PAR: usize, -> MerklePath - where - MerkleChip: MerkleInstructions + Clone, + C: CurveAffine, + MerkleChip, + const PATH_LENGTH: usize, + const K: usize, + const MAX_WORDS: usize, + const PAR: usize, + > MerklePath +where + MerkleChip: MerkleInstructions + Clone, { /// Calculates the root of the tree containing the given leaf at this Merkle path. /// @@ -397,4 +397,4 @@ pub mod tests { .render(11, &circuit, &root) .unwrap(); } -} \ No newline at end of file +} diff --git a/halo2_gadgets_optimized/src/sinsemilla/merkle/chip.rs b/halo2_gadgets_optimized/src/sinsemilla/merkle/chip.rs index 59ed3d40fc..cb3c5be4cc 100644 --- a/halo2_gadgets_optimized/src/sinsemilla/merkle/chip.rs +++ b/halo2_gadgets_optimized/src/sinsemilla/merkle/chip.rs @@ -29,10 +29,10 @@ use group::ff::PrimeField; /// Configuration for the `MerkleChip` implementation. #[derive(Clone, Debug, PartialEq, Eq)] pub struct MerkleConfig - where - Hash: HashDomains, - Fixed: FixedPoints, - Commit: CommitDomains, +where + Hash: HashDomains, + Fixed: FixedPoints, + Commit: CommitDomains, { advices: [Column; 5], q_decompose: Selector, @@ -52,19 +52,19 @@ pub struct MerkleConfig /// `left` and `right`. #[derive(Clone, Debug, PartialEq, Eq)] pub struct MerkleChip - where - Hash: HashDomains, - Fixed: FixedPoints, - Commit: CommitDomains, +where + Hash: HashDomains, + Fixed: FixedPoints, + Commit: CommitDomains, { config: MerkleConfig, } impl Chip for MerkleChip - where - Hash: HashDomains, - Fixed: FixedPoints, - Commit: CommitDomains, +where + Hash: HashDomains, + Fixed: FixedPoints, + Commit: CommitDomains, { type Config = MerkleConfig; type Loaded = (); @@ -79,10 +79,10 @@ impl Chip for MerkleChip } impl MerkleChip - where - Hash: HashDomains, - F: FixedPoints, - Commit: CommitDomains, +where + Hash: HashDomains, + F: FixedPoints, + Commit: CommitDomains, { /// Configures the [`MerkleChip`]. pub fn configure( @@ -197,12 +197,12 @@ impl MerkleChip } impl -MerkleInstructions -for MerkleChip - where - Hash: HashDomains + Eq, - F: FixedPoints, - Commit: CommitDomains + Eq, + MerkleInstructions + for MerkleChip +where + Hash: HashDomains + Eq, + F: FixedPoints, + Commit: CommitDomains + Eq, { #[allow(non_snake_case)] fn hash_layer( @@ -416,19 +416,19 @@ for MerkleChip } impl UtilitiesInstructions for MerkleChip - where - Hash: HashDomains, - F: FixedPoints, - Commit: CommitDomains, +where + Hash: HashDomains, + F: FixedPoints, + Commit: CommitDomains, { type Var = AssignedCell; } impl CondSwapInstructions for MerkleChip - where - Hash: HashDomains, - F: FixedPoints, - Commit: CommitDomains, +where + Hash: HashDomains, + F: FixedPoints, + Commit: CommitDomains, { #[allow(clippy::type_complexity)] fn swap( @@ -456,11 +456,11 @@ impl CondSwapInstructions for MerkleChip SinsemillaInstructions -for MerkleChip - where - Hash: HashDomains, - F: FixedPoints, - Commit: CommitDomains, + for MerkleChip +where + Hash: HashDomains, + F: FixedPoints, + Commit: CommitDomains, { type CellValue = as SinsemillaInstructions< pallas::Affine, @@ -551,4 +551,4 @@ for MerkleChip fn extract(point: &Self::NonIdentityPoint) -> Self::X { SinsemillaChip::::extract(point) } -} \ No newline at end of file +} diff --git a/halo2_gadgets_optimized/src/sinsemilla/primitives.rs b/halo2_gadgets_optimized/src/sinsemilla/primitives.rs index 668558fed9..ad9e397b5e 100644 --- a/halo2_gadgets_optimized/src/sinsemilla/primitives.rs +++ b/halo2_gadgets_optimized/src/sinsemilla/primitives.rs @@ -303,7 +303,7 @@ mod tests { .iter() .cloned() ) - .collect::>(), + .collect::>(), vec![true, true, false, true, false, true, false, true, false, true] ); assert_eq!( @@ -312,7 +312,7 @@ mod tests { .iter() .cloned() ) - .collect::>(), + .collect::>(), vec![ true, true, false, true, false, true, false, true, false, true, true, false, false, false, false, false, false, false, false, false @@ -365,4 +365,4 @@ mod tests { // Test equality assert_eq!(commit1.unwrap(), commit2.unwrap()); } -} \ No newline at end of file +} diff --git a/halo2_gadgets_optimized/src/utilities/cond_swap.rs b/halo2_gadgets_optimized/src/utilities/cond_swap.rs index 6222fcab63..78049e742a 100644 --- a/halo2_gadgets_optimized/src/utilities/cond_swap.rs +++ b/halo2_gadgets_optimized/src/utilities/cond_swap.rs @@ -617,8 +617,8 @@ mod tests { circuit, instance.iter().map(|p| p.to_vec()).collect(), ) - .unwrap(); + .unwrap(); assert_eq!(prover.verify(), Ok(())); } } -} \ No newline at end of file +} diff --git a/halo2_gadgets_optimized/src/utilities/lookup_range_check.rs b/halo2_gadgets_optimized/src/utilities/lookup_range_check.rs index a2dddea4aa..64b4ce4c90 100644 --- a/halo2_gadgets_optimized/src/utilities/lookup_range_check.rs +++ b/halo2_gadgets_optimized/src/utilities/lookup_range_check.rs @@ -147,15 +147,15 @@ impl LookupRangeCheckConfig { // - 0 otherwise let num_bits = q_range_check_5.clone() * Expression::Constant(F::from(5_u64)) + (one.clone() - q_range_check_5) - * q_range_check_4 - * Expression::Constant(F::from(4_u64)); + * q_range_check_4 + * Expression::Constant(F::from(4_u64)); // Combine the running sum, short lookups and optimized range checks: vec![ ( q_lookup.clone() * ((one - q_range_check.clone()) * (running_sum_lookup + short_lookup) - + q_range_check.clone() * z_cur), + + q_range_check.clone() * z_cur), config.table_idx, ), ( @@ -317,7 +317,7 @@ impl LookupRangeCheckConfig { .map(|word| F::from(lebs2ip::(&(word.try_into().unwrap())))) .collect::>() }) - .transpose_vec(num_words) + .transpose_vec(num_words) }; let mut zs = vec![element.clone()]; @@ -721,8 +721,8 @@ mod tests { // => element = shifted * 2^{s-K} let element = shifted * pallas::Base::from(1 << (K as u64 - num_bits)) - .invert() - .unwrap(); + .invert() + .unwrap(); let circuit: MyCircuit = MyCircuit { element: Value::known(element), num_bits: num_bits as usize, @@ -769,4 +769,4 @@ mod tests { ); } } -} \ No newline at end of file +} diff --git a/halo2_proofs/src/circuit.rs b/halo2_proofs/src/circuit.rs index 9c3faf70cd..1083339fed 100644 --- a/halo2_proofs/src/circuit.rs +++ b/halo2_proofs/src/circuit.rs @@ -116,8 +116,8 @@ impl AssignedCell { } impl AssignedCell - where - for<'v> Assigned: From<&'v V>, +where + for<'v> Assigned: From<&'v V>, { /// Returns the field element value of the [`AssignedCell`]. pub fn value_field(&self) -> Value> { @@ -150,8 +150,8 @@ impl From> for AssignedCell, F> { } impl AssignedCell - where - for<'v> Assigned: From<&'v V>, +where + for<'v> Assigned: From<&'v V>, { /// Copies the value to a given advice cell and constrains them to be equal. /// @@ -164,9 +164,9 @@ impl AssignedCell column: Column, offset: usize, ) -> Result - where - A: Fn() -> AR, - AR: Into, + where + A: Fn() -> AR, + AR: Into, { let assigned_cell = region.assign_advice(annotation, column, offset, || self.value.clone())?; @@ -206,9 +206,9 @@ impl<'r, F: Field> Region<'r, F> { selector: &Selector, offset: usize, ) -> Result<(), Error> - where - A: Fn() -> AR, - AR: Into, + where + A: Fn() -> AR, + AR: Into, { self.region .enable_selector(&|| annotation().into(), selector, offset) @@ -224,11 +224,11 @@ impl<'r, F: Field> Region<'r, F> { offset: usize, mut to: V, ) -> Result, Error> - where - V: FnMut() -> Value + 'v, - for<'vr> Assigned: From<&'vr VR>, - A: Fn() -> AR, - AR: Into, + where + V: FnMut() -> Value + 'v, + for<'vr> Assigned: From<&'vr VR>, + A: Fn() -> AR, + AR: Into, { let mut value = Value::unknown(); let cell = @@ -260,10 +260,10 @@ impl<'r, F: Field> Region<'r, F> { offset: usize, constant: VR, ) -> Result, Error> - where - for<'vr> Assigned: From<&'vr VR>, - A: Fn() -> AR, - AR: Into, + where + for<'vr> Assigned: From<&'vr VR>, + A: Fn() -> AR, + AR: Into, { let cell = self.region.assign_advice_from_constant( &|| annotation().into(), @@ -291,9 +291,9 @@ impl<'r, F: Field> Region<'r, F> { advice: Column, offset: usize, ) -> Result, Error> - where - A: Fn() -> AR, - AR: Into, + where + A: Fn() -> AR, + AR: Into, { let (cell, value) = self.region.assign_advice_from_instance( &|| annotation().into(), @@ -333,11 +333,11 @@ impl<'r, F: Field> Region<'r, F> { offset: usize, mut to: V, ) -> Result, Error> - where - V: FnMut() -> Value + 'v, - for<'vr> Assigned: From<&'vr VR>, - A: Fn() -> AR, - AR: Into, + where + V: FnMut() -> Value + 'v, + for<'vr> Assigned: From<&'vr VR>, + A: Fn() -> AR, + AR: Into, { let mut value = Value::unknown(); let cell = @@ -360,8 +360,8 @@ impl<'r, F: Field> Region<'r, F> { /// /// Returns an error if the cell is in a column where equality has not been enabled. pub fn constrain_constant(&mut self, cell: Cell, constant: VR) -> Result<(), Error> - where - VR: Into>, + where + VR: Into>, { self.region.constrain_constant(cell, constant.into()) } @@ -400,11 +400,11 @@ impl<'r, F: Field> Table<'r, F> { offset: usize, mut to: V, ) -> Result<(), Error> - where - V: FnMut() -> Value + 'v, - VR: Into>, - A: Fn() -> AR, - AR: Into, + where + V: FnMut() -> Value + 'v, + VR: Into>, + A: Fn() -> AR, + AR: Into, { self.table .assign_cell(&|| annotation().into(), column, offset, &mut || { @@ -436,10 +436,10 @@ pub trait Layouter { /// }); /// ``` fn assign_region(&mut self, name: N, assignment: A) -> Result - where - A: FnMut(Region<'_, F>) -> Result, - N: Fn() -> NR, - NR: Into; + where + A: FnMut(Region<'_, F>) -> Result, + N: Fn() -> NR, + NR: Into; /// Assign a table region to an absolute row number. /// @@ -450,10 +450,10 @@ pub trait Layouter { /// }); /// ``` fn assign_table(&mut self, name: N, assignment: A) -> Result<(), Error> - where - A: FnMut(Table<'_, F>) -> Result<(), Error>, - N: Fn() -> NR, - NR: Into; + where + A: FnMut(Table<'_, F>) -> Result<(), Error>, + N: Fn() -> NR, + NR: Into; /// Constrains a [`Cell`] to equal an instance column's row value at an /// absolute position. @@ -473,9 +473,9 @@ pub trait Layouter { /// /// Not intended for downstream consumption; use [`Layouter::namespace`] instead. fn push_namespace(&mut self, name_fn: N) - where - NR: Into, - N: FnOnce() -> NR; + where + NR: Into, + N: FnOnce() -> NR; /// Exits out of the existing namespace. /// @@ -484,9 +484,9 @@ pub trait Layouter { /// Enters into a namespace. fn namespace(&mut self, name_fn: N) -> NamespacedLayouter<'_, F, Self::Root> - where - NR: Into, - N: FnOnce() -> NR, + where + NR: Into, + N: FnOnce() -> NR, { self.get_root().push_namespace(name_fn); @@ -503,19 +503,19 @@ impl<'a, F: Field, L: Layouter + 'a> Layouter for NamespacedLayouter<'a, F type Root = L::Root; fn assign_region(&mut self, name: N, assignment: A) -> Result - where - A: FnMut(Region<'_, F>) -> Result, - N: Fn() -> NR, - NR: Into, + where + A: FnMut(Region<'_, F>) -> Result, + N: Fn() -> NR, + NR: Into, { self.0.assign_region(name, assignment) } fn assign_table(&mut self, name: N, assignment: A) -> Result<(), Error> - where - A: FnMut(Table<'_, F>) -> Result<(), Error>, - N: Fn() -> NR, - NR: Into, + where + A: FnMut(Table<'_, F>) -> Result<(), Error>, + N: Fn() -> NR, + NR: Into, { self.0.assign_table(name, assignment) } @@ -534,9 +534,9 @@ impl<'a, F: Field, L: Layouter + 'a> Layouter for NamespacedLayouter<'a, F } fn push_namespace(&mut self, _name_fn: N) - where - NR: Into, - N: FnOnce() -> NR, + where + NR: Into, + N: FnOnce() -> NR, { panic!("Only the root's push_namespace should be called"); } @@ -577,4 +577,4 @@ impl<'a, F: Field, L: Layouter + 'a> Drop for NamespacedLayouter<'a, F, L> { self.get_root().pop_namespace(gadget_name); } -} \ No newline at end of file +}