Skip to main content

format_unified_diff

Function format_unified_diff 

Source
pub fn format_unified_diff(
    old: &str,
    new: &str,
    options: DiffOptions<'_>,
) -> String
Expand description

Formats a structured diff as plain unified text.

Labels are emitted when both DiffOptions::old_label and DiffOptions::new_label are present. Source line terminators are normalized to \n in the formatted output while missing-final-newline hints remain controlled by DiffOptions::missing_newline_hint.