From 0ffa409ec13ef8dad5d7ff75780f980daccc8b7e Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Tue, 24 Mar 2020 11:17:42 +0200 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: Pratyush Mishra --- r1cs-std/src/test_constraint_counter.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/r1cs-std/src/test_constraint_counter.rs b/r1cs-std/src/test_constraint_counter.rs index fc42157..359f71d 100644 --- a/r1cs-std/src/test_constraint_counter.rs +++ b/r1cs-std/src/test_constraint_counter.rs @@ -3,15 +3,15 @@ use algebra::Field; use r1cs_core::{ConstraintSystem, Index, LinearCombination, SynthesisError, Variable}; /// Constraint counter for testing purposes. -pub struct TestConstraintCounter { +pub struct ConstraintCounter { pub num_inputs: usize, pub num_aux: usize, pub num_constraints: usize, } -impl TestConstraintCounter { - pub fn new() -> TestConstraintCounter { - TestConstraintCounter { +impl ConstraintCounter { + pub fn new() -> Self { + Self { num_aux: 0, num_inputs: 0, num_constraints: 0, @@ -23,7 +23,7 @@ impl TestConstraintCounter { } } -impl ConstraintSystem for TestConstraintCounter { +impl ConstraintSystem for ConstraintCounter { type Root = Self; fn alloc(&mut self, _: A, _: F) -> Result @@ -114,7 +114,7 @@ mod tests { let empty_circuit = TestCircuit::(None); let populated_circuit = TestCircuit(Some(Fq::from(10u32))); - let mut counter = TestConstraintCounter::new(); + let mut counter = ConstraintCounter::new(); let mut cs = TestConstraintSystem::new(); empty_circuit