Skip to main content

apply_two_way

Function apply_two_way 

Source
pub fn apply_two_way(a: &Rope, b: &Rope, hunks: &HunkIndex) -> Rope
Expand description

Apply a two-way HunkIndex produced by compute_two_way(a, b) to a, reading replacement content from b. The result equals b (this is the round-trip invariant the property tests assert).

Walks hunks in reverse so earlier indices stay valid as we mutate later ones first.