diff --git a/src/r1cs/constraint_system.rs b/src/r1cs/constraint_system.rs index cf327f26..05e31734 100644 --- a/src/r1cs/constraint_system.rs +++ b/src/r1cs/constraint_system.rs @@ -106,7 +106,7 @@ pub trait RandomizableConstraintSystem: ConstraintSystem { /// ``` fn specify_randomized_constraints(&mut self, callback: F) -> Result<(), R1CSError> where - F: 'static + Fn(&mut Self::RandomizedCS) -> Result<(), R1CSError>; + F: 'static + FnOnce(&mut Self::RandomizedCS) -> Result<(), R1CSError>; } /// Represents a constraint system in the second phase: diff --git a/src/r1cs/prover.rs b/src/r1cs/prover.rs index 75c62d1f..96d44398 100644 --- a/src/r1cs/prover.rs +++ b/src/r1cs/prover.rs @@ -37,7 +37,8 @@ pub struct Prover<'g, T: BorrowMut> { /// This list holds closures that will be called in the second phase of the protocol, /// when non-randomized variables are committed. - deferred_constraints: Vec) -> Result<(), R1CSError>>>, + deferred_constraints: + Vec) -> Result<(), R1CSError>>>, /// Index of a pending multiplier that's not fully assigned yet. pending_multiplier: Option, @@ -182,7 +183,7 @@ impl<'g, T: BorrowMut> RandomizableConstraintSystem for Prover<'g, T fn specify_randomized_constraints(&mut self, callback: F) -> Result<(), R1CSError> where - F: 'static + Fn(&mut Self::RandomizedCS) -> Result<(), R1CSError>, + F: 'static + FnOnce(&mut Self::RandomizedCS) -> Result<(), R1CSError>, { self.deferred_constraints.push(Box::new(callback)); Ok(()) diff --git a/src/r1cs/verifier.rs b/src/r1cs/verifier.rs index cddbd425..28318749 100644 --- a/src/r1cs/verifier.rs +++ b/src/r1cs/verifier.rs @@ -43,7 +43,8 @@ pub struct Verifier> { /// when non-randomized variables are committed. /// After that, the option will flip to None and additional calls to `randomize_constraints` /// will invoke closures immediately. - deferred_constraints: Vec) -> Result<(), R1CSError>>>, + deferred_constraints: + Vec) -> Result<(), R1CSError>>>, /// Index of a pending multiplier that's not fully assigned yet. pending_multiplier: Option, @@ -134,7 +135,7 @@ impl> RandomizableConstraintSystem for Verifier { fn specify_randomized_constraints(&mut self, callback: F) -> Result<(), R1CSError> where - F: 'static + Fn(&mut Self::RandomizedCS) -> Result<(), R1CSError>, + F: 'static + FnOnce(&mut Self::RandomizedCS) -> Result<(), R1CSError>, { self.deferred_constraints.push(Box::new(callback)); Ok(())