arkworks-rs / snark

Interfaces for Relations and SNARKs for these relations
https://www.arkworks.rs
Apache License 2.0
770 stars 207 forks source link

Make `ConstraintSynthesizer::generate_constraints` not consume `self` by value #323

Open Pratyush opened 3 years ago

weikengchen commented 3 years ago

Does it mean that we just change self to &self?

My first attempt shows that this seems good: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=0dcc9126df1c78347ad34fc5238617a4

Pratyush commented 3 years ago

yeah, it's mostly just an issue with updating everything downstream =)

Pratyush commented 3 years ago

@weikengchen Now that cloning ConstraintSystemRef is cheap, is this still an issue?

weikengchen commented 3 years ago

Nope? Because the one that may need cloning is ConstraintSynthesizer rather than ConstraintSystemRef.

Pratyush commented 3 years ago

Oh oops, misread the title lol. Ok, will address this in my current set of changes.