1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +00:00

LibWeb: Make StyleValue::to_string() infallible

This commit is contained in:
Sam Atkins 2023-08-22 14:08:15 +01:00 committed by Sam Atkins
parent ccfe197e5a
commit 7fe97ee6c5
112 changed files with 425 additions and 430 deletions

View file

@ -16,7 +16,7 @@ bool StyleValueList::Properties::operator==(Properties const& other) const
return separator == other.separator && values.span() == other.values.span();
}
ErrorOr<String> StyleValueList::to_string() const
String StyleValueList::to_string() const
{
auto separator = ""sv;
switch (m_properties.separator) {
@ -32,11 +32,11 @@ ErrorOr<String> StyleValueList::to_string() const
StringBuilder builder;
for (size_t i = 0; i < m_properties.values.size(); ++i) {
TRY(builder.try_append(TRY(m_properties.values[i]->to_string())));
builder.append(m_properties.values[i]->to_string());
if (i != m_properties.values.size() - 1)
TRY(builder.try_append(separator));
builder.append(separator);
}
return builder.to_string();
return MUST(builder.to_string());
}
}