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.
This commit is contained in:
Andreas Kling 2021-11-10 14:33:44 +01:00
commit a15ed8743d
Notes: sideshowbarker 2024-07-18 03:23:00 +09:00
20 changed files with 59 additions and 70 deletions

View file

@ -64,7 +64,7 @@ public:
}
private:
bool will_append(size_t);
ErrorOr<void> will_append(size_t);
u8* data() { return m_buffer.data(); }
u8 const* data() const { return m_buffer.data(); }