Skip to main content

generate_unified_diff

Function generate_unified_diff 

Source
pub fn generate_unified_diff(
    old_content: &str,
    new_content: &str,
    old_path: &str,
    new_path: &str,
) -> String
Expand description

Generate a unified diff from two strings — choreograph the combo notation.

Uses a simplified line-by-line diff algorithm based on longest common subsequence (LCS) to produce standard unified diff output with context lines.