1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:04:59 +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) {
buffer = Core::File::standard_input()->read_all();
} else {
auto result = Core::File::open(filepath, Core::OpenMode::ReadOnly);
VERIFY(!result.is_error());
auto file = result.value();
auto file = TRY(Core::File::open(filepath, Core::OpenMode::ReadOnly));
buffer = file->read_all();
}