LibDiff: Make Diff::from_text fallible

This commit is contained in:
Shannon Booth
2023-06-24 12:57:38 +12:00
committed by Andreas Kling
parent 23df5748f6
commit ee92378b80
5 changed files with 22 additions and 17 deletions

View File

@@ -31,7 +31,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto const color_output = TRY(Core::System::isatty(STDOUT_FILENO)) ? Diff::ColorOutput::Yes : Diff::ColorOutput::No;
auto hunks = Diff::from_text(TRY(file1->read_until_eof()), TRY(file2->read_until_eof()));
auto hunks = TRY(Diff::from_text(TRY(file1->read_until_eof()), TRY(file2->read_until_eof())));
for (auto const& hunk : hunks)
TRY(Diff::write_normal(hunk, *out, color_output));