-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add into_inner
function for ConstraintSystemRef<F>
#347
Conversation
Question: the comment said that it "panics if any other references to From the code, it panics in the case when |
Maybe just have the method return an Option? That way the decision to panic is left to users |
I think going with an option is better as well |
/// `Self::CS` exist. | ||
pub fn into_inner(self) -> Option<ConstraintSystem<F>> { | ||
match self { | ||
Self::CS(a) => Some(Rc::try_unwrap(a).unwrap().into_inner()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn’t this just use a map
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with map in 1cfae51. Have to use a clone on Rc
but I guess it should be okay.
Ready for a final pass. |
Description
Adds a helper function to unwrap a
ConstraintSystemRef<F>
. This is useful for managing memory in arkworks-rs/marlin#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.
Pending
section inCHANGELOG.md
Files changed
in the Github PR explorer