Skip to content

Build Regex from static string in a const way #1256

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

Closed
ValentinColin opened this issue Mar 19, 2025 · 1 comment
Closed

Build Regex from static string in a const way #1256

ValentinColin opened this issue Mar 19, 2025 · 1 comment

Comments

@ValentinColin
Copy link

Describe your feature request

Regex are often hardcoded, so it would be nice to be able to build a Regex from a static str in a const context to avoid handling error that will never happens. The build step of the regex we be done a compile time and not at runtime.

Example with the crate http: http::header::HeaderValue::from_static(&'static str).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants