mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibURL: Make URL::serialized_host() infallible
This can no longer fail, so update the return type to match.
This makes a few more methods now unable to return errors, but one thing
at a time. 😅
This commit is contained in:
parent
70c8535b8a
commit
900c131178
Notes:
github-actions[bot]
2024-11-30 11:23:28 +00:00
Author: https://github.com/AtkinsSJ
Commit: 900c131178
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2610
Reviewed-by: https://github.com/shannonbooth ✅
13 changed files with 47 additions and 51 deletions
|
@ -86,7 +86,7 @@ void URL::set_host(Host host)
|
|||
}
|
||||
|
||||
// https://url.spec.whatwg.org/#concept-host-serializer
|
||||
ErrorOr<String> URL::serialized_host() const
|
||||
String URL::serialized_host() const
|
||||
{
|
||||
return m_data->host->serialize();
|
||||
}
|
||||
|
@ -273,7 +273,7 @@ ByteString URL::serialize(ExcludeFragment exclude_fragment) const
|
|||
}
|
||||
|
||||
// 3. Append url’s host, serialized, to output.
|
||||
output.append(serialized_host().release_value_but_fixme_should_propagate_errors());
|
||||
output.append(serialized_host());
|
||||
|
||||
// 4. If url’s port is non-null, append U+003A (:) followed by url’s port, serialized, to output.
|
||||
if (m_data->port.has_value())
|
||||
|
@ -324,7 +324,7 @@ ByteString URL::serialize_for_display() const
|
|||
|
||||
if (m_data->host.has_value()) {
|
||||
builder.append("//"sv);
|
||||
builder.append(serialized_host().release_value_but_fixme_should_propagate_errors());
|
||||
builder.append(serialized_host());
|
||||
if (m_data->port.has_value())
|
||||
builder.appendff(":{}", *m_data->port);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue