diff --git a/src/r1cs/constraint_system.rs b/src/r1cs/constraint_system.rs index 7e4e01f2..aa2ba9e7 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 598d9c2e..6c2e3a22 100644 --- a/src/r1cs/prover.rs +++ b/src/r1cs/prover.rs @@ -38,7 +38,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, @@ -188,7 +189,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 a397fd94..4570d386 100644 --- a/src/r1cs/verifier.rs +++ b/src/r1cs/verifier.rs @@ -44,7 +44,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, @@ -140,7 +141,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(())