mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
LibDiff: Make Diff::parse_hunks fallible
Currently the only error that can happen is an OOM. However, in the future there may be other errors that this function may throw, such as detecting an invalid patch.
This commit is contained in:
parent
dbd838efdf
commit
23df5748f6
Notes:
sideshowbarker
2024-07-17 17:49:11 +09:00
Author: https://github.com/shannonbooth
Commit: 23df5748f6
Pull-request: https://github.com/SerenityOS/serenity/pull/19592
Reviewed-by: https://github.com/kennethmyhra ✅
4 changed files with 10 additions and 9 deletions
|
@ -134,7 +134,7 @@ Gfx::IntRect DiffViewer::separator_rect() const
|
|||
void DiffViewer::set_content(DeprecatedString const& original, DeprecatedString const& diff)
|
||||
{
|
||||
m_original_lines = split_to_lines(original);
|
||||
m_hunks = Diff::parse_hunks(diff);
|
||||
m_hunks = Diff::parse_hunks(diff).release_value_but_fixme_should_propagate_errors();
|
||||
|
||||
if constexpr (DIFF_DEBUG) {
|
||||
for (size_t i = 0; i < m_original_lines.size(); ++i)
|
||||
|
@ -149,7 +149,7 @@ DiffViewer::DiffViewer()
|
|||
|
||||
DiffViewer::DiffViewer(DeprecatedString const& original, DeprecatedString const& diff)
|
||||
: m_original_lines(split_to_lines(original))
|
||||
, m_hunks(Diff::parse_hunks(diff))
|
||||
, m_hunks(Diff::parse_hunks(diff).release_value_but_fixme_should_propagate_errors())
|
||||
{
|
||||
setup_properties();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue