1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

ParsedURL: Remove url field

This prevents a 'url' field that is out of sync with the other
fields. You can use to_string() to get the full URL.
This commit is contained in:
Eelco Dolstra 2025-01-07 14:45:58 +01:00
parent a0901e5588
commit f705ce7f9a
8 changed files with 25 additions and 43 deletions

View file

@ -40,7 +40,6 @@ ParsedURL parseURL(const std::string & url)
path = "/";
return ParsedURL{
.url = url,
.base = base,
.scheme = scheme,
.authority = authority,
@ -136,6 +135,12 @@ std::string ParsedURL::to_string() const
+ (fragment.empty() ? "" : "#" + percentEncode(fragment));
}
std::ostream & operator << (std::ostream & os, const ParsedURL & url)
{
os << url.to_string();
return os;
}
bool ParsedURL::operator ==(const ParsedURL & other) const noexcept
{
return