Skip to main content

unified_diff

Function unified_diff 

Source
pub fn unified_diff(path: &str, old: &str, new: &str) -> FileDiff
Expand description

Compute a unified diff between old and new content for the given file path.

Uses similar::TextDiff to compute the diff and formats it as a standard unified diff with --- a/<path> and +++ b/<path> headers.

If there are no changes, returns a FileDiff with has_changes: false and empty hunks.