http icon indicating copy to clipboard operation
http copied to clipboard

Uri/Authority/PathAndQuery::from_static should be const

Open carlsverre opened this issue 9 months ago • 3 comments
trafficstars

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.

carlsverre avatar Jan 31 '25 01:01 carlsverre

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

seanmonstar avatar Jan 31 '25 11:01 seanmonstar

I can take this up.

zaira-bibi avatar Apr 07 '25 09:04 zaira-bibi

Also want this feature

incker avatar May 25 '25 12:05 incker