1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:17:35 +00:00

HexEditor: Make HexEditor::open_new_file fallible and reduce branching

Returning a `bool` is meaningless, so let's make it more expresive :^)
This commit is contained in:
James Puleo 2022-07-28 03:34:15 -04:00 committed by Tim Flynn
parent 035d63f528
commit 88cf40179d
3 changed files with 15 additions and 18 deletions

View file

@ -33,7 +33,7 @@ public:
virtual ~HexEditor() override = default;
size_t buffer_size() const { return m_document->size(); }
bool open_new_file(size_t size);
ErrorOr<void> open_new_file(size_t size);
void open_file(NonnullRefPtr<Core::File> file);
void fill_selection(u8 fill_byte);
Optional<u8> get_byte(size_t position);