Skip to main content

diff_edit

Function diff_edit 

Source
pub fn diff_edit(old: &str, new: &str) -> Edit
Expand description

Recover a single contiguous Edit (deleted range in old + inserted text) from a pair of full texts by stripping the common prefix and suffix. Multiple disjoint edits collapse into one spanning edit — still a correct transform, just coarser. Boundaries are clamped to char boundaries.