mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:44:58 +00:00
LibDiff: Make Diff::from_text fallible
This commit is contained in:
parent
23df5748f6
commit
ee92378b80
5 changed files with 22 additions and 17 deletions
|
@ -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));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue