AK+Everywhere: Change StringView case conversions to return String

There's a bit of a UTF-8 assumption with this change. But nearly every
caller of these methods were immediately creating a String from the
resulting ByteString anyways.
This commit is contained in:
Timothy Flynn 2025-04-06 10:19:35 -04:00 committed by Andreas Kling
commit 0a256b0a9a
Notes: github-actions[bot] 2025-04-07 15:45:50 +00:00
15 changed files with 57 additions and 56 deletions

View file

@ -488,7 +488,7 @@ ByteString to_snakecase(StringView str)
return builder.to_byte_string();
}
ByteString to_titlecase(StringView str)
String to_titlecase(StringView str)
{
StringBuilder builder;
bool next_is_upper = true;
@ -501,7 +501,7 @@ ByteString to_titlecase(StringView str)
next_is_upper = ch == ' ';
}
return builder.to_byte_string();
return MUST(builder.to_string());
}
// Finishes the replacing algorithm once it is known that ita least one