Closed DonIsaac closed 1 month ago
Doesn't this make it impossible to parse http://example.org:0/
?
That's still a valid URL according to the URL standard.
Yes, it is a valid port. It appears to be used for some use cases in the wild. I'm wondering if/how we could get this memory layout improvement without impacting users that need port 0. Maybe a feature flag?
I don't think this is possible for port, but I encourage you to explore options for
query_start: Option<u32>, // Before '?', unlike Position::QueryStart
fragment_start: Option<u32>, // Before '#', unlike Position::FragmentStart
If I'm not mistaken, it should be impossible for them to start at 0.
Proposal implementation for #930
I've left the public API unchanged; all public port getter/setters still deal with
u16
s.