Skip to content
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

Refactor: change lifetime for parameter var_name of get_constant_from_var_name from 'static to 'a #1522

Open
Eikix opened this issue Dec 21, 2023 · 0 comments · May be fixed by #1523
Open
Labels
enhancement New feature or request

Comments

@Eikix
Copy link
Contributor

Eikix commented Dec 21, 2023

remove static lifetime for name str parameter requirement for constant getter

Description

Hey!
I noticed get_constant_from_var_name has a different signature from other hint_utils helper functions, namely that it has a bound of static lifetime on the name parameter. I noticed it mainly comes from the error signature HintError::MissingConstant.

I changed the signature of MissingConstant to match other errors: from Box<'static &str> to Box using the same util you use around the hint error codebase: var_name.to_string().into_boxed_str().

In doing this, one no longer needs to have 'static strings for constant getting -> this will allow me in next PRs to have dynamic constant name getting, i.e., in garaga there are constant limbs of Prime P of the BN Curve.
And depending on N_LIMBS, we'll get P_i.

Let me know if this works!

@Eikix Eikix added the enhancement New feature or request label Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

Successfully merging a pull request may close this issue.

1 participant