mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:17:35 +00:00
AK: Make "foo"_string infallible
Stop worrying about tiny OOMs. Work towards #20405.
This commit is contained in:
parent
db2a8725c6
commit
34344120f2
181 changed files with 626 additions and 630 deletions
|
@ -280,9 +280,9 @@ struct Formatter<String> : Formatter<StringView> {
|
|||
|
||||
}
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE AK::ErrorOr<AK::String> operator""_string(char const* cstring, size_t length)
|
||||
[[nodiscard]] ALWAYS_INLINE AK::String operator""_string(char const* cstring, size_t length)
|
||||
{
|
||||
return AK::String::from_utf8(AK::StringView(cstring, length));
|
||||
return AK::String::from_utf8(AK::StringView(cstring, length)).release_value();
|
||||
}
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE AK_SHORT_STRING_CONSTEVAL AK::String operator""_short_string(char const* cstring, size_t length)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue