Skip to main content

compute_diff

Function compute_diff 

Source
pub fn compute_diff<F>(
    old: &str,
    new: &str,
    options: DiffOptions<'_>,
    formatter: F,
) -> DiffBundle
where F: FnOnce(&[DiffHunk], &DiffOptions<'_>) -> String,
Expand description

Computes a structured diff and passes non-empty hunks to a formatter.

ยงContract

  • Requires: nothing (any &str pair accepted).
  • Ensures: identical inputs yield an empty bundle without invoking formatter; otherwise the bundle carries the computed hunks.