1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:48:11 +00:00

base64: Use TRY() instead of VERIFY(!result.is_error())

This commit is contained in:
Kenneth Myhra 2022-04-30 21:14:13 +02:00 committed by Linus Groh
parent ec1f5fd20f
commit bd81e15bc9

View file

@ -27,9 +27,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
if (filepath == nullptr || strcmp(filepath, "-") == 0) { if (filepath == nullptr || strcmp(filepath, "-") == 0) {
buffer = Core::File::standard_input()->read_all(); buffer = Core::File::standard_input()->read_all();
} else { } else {
auto result = Core::File::open(filepath, Core::OpenMode::ReadOnly); auto file = TRY(Core::File::open(filepath, Core::OpenMode::ReadOnly));
VERIFY(!result.is_error());
auto file = result.value();
buffer = file->read_all(); buffer = file->read_all();
} }