diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-10 14:33:44 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-10 21:58:58 +0100 |
commit | a15ed8743d03c6c683f19447be20ca7dac768485 (patch) | |
tree | fe3b808b4909686757dae5c4a949ba18fe7e5eba /Userland/Libraries/LibLine | |
parent | 88b6428c25ea046a4bb19bb6f3f68dd4f1439539 (diff) | |
download | serenity-a15ed8743d03c6c683f19447be20ca7dac768485.zip |
AK: Make ByteBuffer::try_* functions return ErrorOr<void>
Same as Vector, ByteBuffer now also signals allocation failure by
returning an ENOMEM Error instead of a bool, allowing us to use the
TRY() and MUST() patterns.
Diffstat (limited to 'Userland/Libraries/LibLine')
-rw-r--r-- | Userland/Libraries/LibLine/Editor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp index c55c70e08e..1969aed99a 100644 --- a/Userland/Libraries/LibLine/Editor.cpp +++ b/Userland/Libraries/LibLine/Editor.cpp @@ -370,7 +370,7 @@ void Editor::insert(const u32 cp) StringBuilder builder; builder.append(Utf32View(&cp, 1)); auto str = builder.build(); - if (!m_pending_chars.try_append(str.characters(), str.length())) + if (m_pending_chars.try_append(str.characters(), str.length()).is_error()) return; readjust_anchored_styles(m_cursor, ModificationKind::Insertion); |