diff options
author | Jelle Raaijmakers <jelle@gmta.nl> | 2022-12-19 00:23:47 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-20 10:34:19 +0100 |
commit | 25f2e4981c1236f69776c290fba7472ec7714869 (patch) | |
tree | bf46d80f5e93fe9590dc990082751c7b320fc9dd /AK/Base64.cpp | |
parent | 99c1b634fc80c922ca4867e4eac83b73e4c28304 (diff) | |
download | serenity-25f2e4981c1236f69776c290fba7472ec7714869.zip |
AK: Stop using `DeprecatedString` in Base64 encoding
Diffstat (limited to 'AK/Base64.cpp')
-rw-r--r-- | AK/Base64.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/AK/Base64.cpp b/AK/Base64.cpp index 0093481a67..f60340e1ad 100644 --- a/AK/Base64.cpp +++ b/AK/Base64.cpp @@ -100,7 +100,7 @@ ErrorOr<ByteBuffer> decode_base64(StringView input) return ByteBuffer::copy(output); } -DeprecatedString encode_base64(ReadonlyBytes input) +ErrorOr<String> encode_base64(ReadonlyBytes input) { StringBuilder output(calculate_base64_encoded_length(input)); @@ -131,13 +131,13 @@ DeprecatedString encode_base64(ReadonlyBytes input) char const out2 = is_16bit ? '=' : alphabet[index2]; char const out3 = is_8bit ? '=' : alphabet[index3]; - output.append(out0); - output.append(out1); - output.append(out2); - output.append(out3); + TRY(output.try_append(out0)); + TRY(output.try_append(out1)); + TRY(output.try_append(out2)); + TRY(output.try_append(out3)); } - return output.to_deprecated_string(); + return output.to_string(); } } |