mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 06:52:52 +00:00
AK: Introduce a fallible version of StringBuilder::to_byte_buffer
Name it StringBuilder::try_to_byte_buffer accordingly :^)
This commit is contained in:
parent
8b8e91d4da
commit
b4b283670d
Notes:
sideshowbarker
2024-07-17 03:18:29 +09:00
Author: https://github.com/karolba
Commit: b4b283670d
Pull-request: https://github.com/SerenityOS/serenity/pull/17746
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
Reviewed-by: https://github.com/linusg
2 changed files with 6 additions and 0 deletions
|
@ -111,6 +111,11 @@ ByteBuffer StringBuilder::to_byte_buffer() const
|
|||
return ByteBuffer::copy(data(), length()).release_value_but_fixme_should_propagate_errors();
|
||||
}
|
||||
|
||||
ErrorOr<ByteBuffer> StringBuilder::try_to_byte_buffer() const
|
||||
{
|
||||
return TRY(ByteBuffer::copy(data(), length()));
|
||||
}
|
||||
|
||||
#ifndef KERNEL
|
||||
DeprecatedString StringBuilder::to_deprecated_string() const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue