AK: Add DeprecatedString::from_utf8(StringView)
This mirrors String::from_utf8(StringView). Jakt will use this to construct strings instead of just assuming the allocation will succeed, lowering the API difference between Jakt::String and AK::String by one API :^)
This commit is contained in:
parent
4a82f9bd03
commit
a28aba7663
Notes:
sideshowbarker
2024-07-17 21:11:12 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/a28aba7663 Pull-request: https://github.com/SerenityOS/serenity/pull/18071
1 changed files with 1 additions and 0 deletions
|
@ -95,6 +95,7 @@ public:
|
|||
DeprecatedString(DeprecatedFlyString const&);
|
||||
|
||||
static ErrorOr<DeprecatedString> from_utf8(ReadonlyBytes);
|
||||
static ErrorOr<DeprecatedString> from_utf8(StringView string) { return from_utf8(string.bytes()); }
|
||||
|
||||
[[nodiscard]] static DeprecatedString repeated(char, size_t count);
|
||||
[[nodiscard]] static DeprecatedString repeated(StringView, size_t count);
|
||||
|
|
Loading…
Add table
Reference in a new issue