You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is to have only one function that operates depending on the parameter passed.
This will reduce the code complexity and provide an easier usage for the end user.
The text was updated successfully, but these errors were encountered:
As the functions like result() and pad() have variadic arguments depending if we are working with R1CS or not, the only way to optimize the code (macros are inline) and also reduce the duplicate code is to use mentioned macros. Since type matching is quite ugly to apply.
Another option (that will prioritize readability) will be to implement these functions passing the extra parameters (if we work with R1CS) with Options.
Something like:
pubfnconstrain_result(&mutself,cs:Option<&mutdynConstraintSystem>,) -> Result<Vec<T>,PermError>{match cs {}// Check if we have a cs or we are not in the R1CS case.// Code....}
On the code we find examples of duplicated code on which we maybe can apply pattern-matching techniques:
or:
The idea is to have only one function that operates depending on the parameter passed.
This will reduce the code complexity and provide an easier usage for the end user.
The text was updated successfully, but these errors were encountered: