arkworks-rs / snark

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

Add `into_inner` function for `ConstraintSystemRef<F>` #347

Closed ryanleh closed 3 years ago

ryanleh commented 3 years ago

Description

Adds a helper function to unwrap a ConstraintSystemRef<F>. This is useful for managing memory in https://github.com/arkworks-rs/marlin/pull/71.


Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why.

weikengchen commented 3 years ago

Question: the comment said that it "panics if any other references to self exist."

From the code, it panics in the case when ConstraintSystemRef does not contain a ConstraintSystem?

Pratyush commented 3 years ago

Maybe just have the method return an Option? That way the decision to panic is left to users

ValarDragon commented 3 years ago

I think going with an option is better as well

weikengchen commented 3 years ago

Ready for a final pass.