1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:57:45 +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

@ -6,7 +6,6 @@
#pragma once
#include <AK/Error.h>
#include <AK/Optional.h>
#include <AK/String.h>
#include <AK/StringView.h>
@ -65,13 +64,13 @@ Optional<StringView> get_number_system_symbol(StringView locale, StringView syst
Optional<NumberGroupings> get_number_system_groupings(StringView locale, StringView system);
Optional<ReadonlySpan<u32>> get_digits_for_number_system(StringView system);
ErrorOr<String> replace_digits_for_number_system(StringView system, StringView number);
String replace_digits_for_number_system(StringView system, StringView number);
ErrorOr<Optional<NumberFormat>> get_standard_number_system_format(StringView locale, StringView system, StandardNumberFormatType type);
ErrorOr<Vector<NumberFormat>> get_compact_number_system_formats(StringView locale, StringView system, CompactNumberFormatType type);
ErrorOr<Vector<NumberFormat>> get_unit_formats(StringView locale, StringView unit, Style style);
Optional<NumberFormat> get_standard_number_system_format(StringView locale, StringView system, StandardNumberFormatType type);
Vector<NumberFormat> get_compact_number_system_formats(StringView locale, StringView system, CompactNumberFormatType type);
Vector<NumberFormat> get_unit_formats(StringView locale, StringView unit, Style style);
ErrorOr<Optional<String>> augment_currency_format_pattern(StringView currency_display, StringView base_pattern);
ErrorOr<Optional<String>> augment_range_pattern(StringView range_separator, StringView lower, StringView upper);
Optional<String> augment_currency_format_pattern(StringView currency_display, StringView base_pattern);
Optional<String> augment_range_pattern(StringView range_separator, StringView lower, StringView upper);
}