LibURL+LibWeb: Make URL::serialize return a String

Simplifying a bunch of uneeded error handling around the place.
This commit is contained in:
Shannon Booth
2024-12-03 22:31:33 +13:00
committed by Sam Atkins
parent d7ac0601ab
commit 0fa54c2327
52 changed files with 88 additions and 103 deletions

View File

@@ -66,7 +66,7 @@ String CSSFontFaceRule::serialized() const
// 2. The result of invoking serialize a comma-separated list on performing serialize a URL or serialize a LOCAL for each source on the source list.
serialize_a_comma_separated_list(builder, m_font_face.sources(), [&](StringBuilder& builder, ParsedFontFace::Source source) -> void {
if (source.local_or_url.has<URL::URL>()) {
serialize_a_url(builder, MUST(source.local_or_url.get<URL::URL>().to_string()));
serialize_a_url(builder, source.local_or_url.get<URL::URL>().to_string());
} else {
builder.appendff("local({})", source.local_or_url.get<String>());
}