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

LibLocale+LibJS: Make number format APIs infallible

These APIs only perform small allocations, and are only used by LibJS.
Callers which could only have failed from these APIs are also made to
be infallible here.
This commit is contained in:
Timothy Flynn 2023-08-22 16:12:51 -04:00 committed by Andreas Kling
parent cd526813e6
commit 0914e86691
6 changed files with 56 additions and 57 deletions

View file

@ -296,7 +296,7 @@ static ErrorOr<Optional<String>> format_time_zone_offset(StringView locale, Cale
}
// The digits used for hours, minutes and seconds fields in this format are the locale's default decimal digits.
auto result = TRY(replace_digits_for_number_system(*number_system, TRY(builder.to_string())));
auto result = replace_digits_for_number_system(*number_system, TRY(builder.to_string()));
return TRY(String::from_utf8(formats->gmt_format)).replace("{0}"sv, result, ReplaceMode::FirstOnly);
}