diff --git a/Userland/Utilities/gron.cpp b/Userland/Utilities/gron.cpp index a86494a605..deafb76935 100644 --- a/Userland/Utilities/gron.cpp +++ b/Userland/Utilities/gron.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -41,16 +41,11 @@ ErrorOr serenity_main(Main::Arguments arguments) args_parser.add_positional_argument(path, "Input", "input", Core::ArgsParser::Required::No); args_parser.parse(arguments); - RefPtr file; - - if (path.is_null()) - file = Core::File::standard_input(); - else - file = TRY(Core::File::open(path, Core::OpenMode::ReadOnly)); + auto file = TRY(Core::Stream::File::open_file_or_standard_stream(path, Core::Stream::OpenMode::Read)); TRY(Core::System::pledge("stdio")); - auto file_contents = file->read_all(); + auto file_contents = TRY(file->read_all()); auto json = TRY(JsonValue::from_string(file_contents)); if (use_color) {