AK: Add ByteString::from_utf8_without_validation()
This will be used by Jakt to create ByteString from string literals which we can validate at compile time instead of runtime. :^)
This commit is contained in:
parent
0f37e0ee89
commit
9f0aa08468
Notes:
sideshowbarker
2024-07-17 00:57:24 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9f0aa08468
1 changed files with 1 additions and 0 deletions
|
@ -91,6 +91,7 @@ public:
|
|||
static ErrorOr<ByteString> from_utf8(ReadonlyBytes);
|
||||
static ErrorOr<ByteString> from_utf8(StringView string) { return from_utf8(string.bytes()); }
|
||||
static ByteString must_from_utf8(StringView string) { return MUST(from_utf8(string)); }
|
||||
static ByteString from_utf8_without_validation(StringView string) { return ByteString { string }; }
|
||||
|
||||
[[nodiscard]] static ByteString repeated(char, size_t count);
|
||||
[[nodiscard]] static ByteString repeated(StringView, size_t count);
|
||||
|
|
Loading…
Add table
Reference in a new issue