Skip to main content

structured_diff

Function structured_diff 

Source
pub fn structured_diff(old_text: &str, new_text: &str) -> String
Expand description

Compute a structured line-level diff between two texts.

Returns a JSON-serialized StructuredDiffResult with interleaved context, added, and removed lines including line numbers for both old and new text. This is the single source of truth for diff display.

Uses the same LCS algorithm as compute_diff but produces full line-by-line output instead of just counts.