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

Uri/Authority/PathAndQuery::from_static should be const #750

Open
carlsverre opened this issue Jan 31, 2025 · 1 comment
Open

Uri/Authority/PathAndQuery::from_static should be const #750

carlsverre opened this issue Jan 31, 2025 · 1 comment
Labels
A-uri Area: Uri and parts E-easy Effort: easy. Start here :D S-feature Severity: feature. This adds something new.

Comments

@carlsverre
Copy link

Currently using from_static to build Uri, Authority, or PathAndQuery types can't be done in a const context. From inspecting what they do under the hood, it seems like the parsing logic would be possible to extract into a const fn. Is there some other limitation preventing these methods from being const?

My use case is building Uri components at compile time for trivial assembly at runtime.

@seanmonstar
Copy link
Member

I don't think there's a reason, other than no one has done so yet.

@seanmonstar seanmonstar added S-feature Severity: feature. This adds something new. E-easy Effort: easy. Start here :D A-uri Area: Uri and parts labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-uri Area: Uri and parts E-easy Effort: easy. Start here :D S-feature Severity: feature. This adds something new.
Projects
None yet
Development

No branches or pull requests

2 participants