mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:34:57 +00:00
Everywhere: Remove needless copies of Error / ErrorOr instances
Either take the underlying objects with release_* methods or move() the instances around.
This commit is contained in:
parent
52687814ea
commit
4a916cd379
28 changed files with 69 additions and 77 deletions
|
@ -110,7 +110,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
if (event.type == Core::FileWatcherEvent::Type::ContentModified) {
|
||||
auto buffer_or_error = f->read_until_eof();
|
||||
if (buffer_or_error.is_error()) {
|
||||
auto error = buffer_or_error.error();
|
||||
auto error = buffer_or_error.release_error();
|
||||
warnln(error.string_literal());
|
||||
event_loop.quit(error.code());
|
||||
return;
|
||||
|
@ -120,7 +120,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
|
||||
auto potential_error = f->seek(0, SeekMode::FromEndPosition);
|
||||
if (potential_error.is_error()) {
|
||||
auto error = potential_error.error();
|
||||
auto error = potential_error.release_error();
|
||||
warnln(error.string_literal());
|
||||
event_loop.quit(error.code());
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue