Skip to main content

word_level_changed_ranges

Function word_level_changed_ranges 

Source
pub fn word_level_changed_ranges(
    old: &str,
    new: &str,
) -> (Vec<(usize, usize)>, Vec<(usize, usize)>)
Expand description

Computes byte-safe word-level changed ranges for a line pair.

ยงContract

  • Requires: nothing beyond valid &str inputs.
  • Ensures: every returned range is a char-boundary range within its side, and an empty input or an over-budget pair (> 16_384 bytes) yields no ranges. Overflow-free: offsets advance with saturating_add.
  • Termination: single pass over similar changes.