Skip to main content

show_edit_diff

Function show_edit_diff 

Source
pub fn show_edit_diff<W: Write>(
    stdout: &mut W,
    path: &str,
    old_str: &str,
    new_str: &str,
) -> Result<(), Box<dyn Error>>
Expand description

Show a unified-diff-style view of an edit operation. Reads the file, locates old_str, and prints context lines with the removed text in red and the replacement in green.