MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / diff

Function diff

atomic-core/src/diff/mod.rs:172–174  ·  view source on GitHub ↗

Compute the diff between two sequences of lines. This is the main entry point for diffing. It takes two slices of [`Line`]s and returns a [`DiffResult`] containing the operations needed to transform the old sequence into the new one. # Arguments `old` - The original sequence of lines `new` - The modified sequence of lines `algorithm` - Which diff algorithm to use # Returns A [`DiffResult`] co

(old: &[Line<'a>], new: &[Line<'a>], algorithm: Algorithm)

Source from the content-addressed store, hash-verified

170/// assert!(!result.is_empty());
171/// ```
172pub fn diff<'a>(old: &[Line<'a>], new: &[Line<'a>], algorithm: Algorithm) -> DiffResult {
173 diff_with_options(old, new, algorithm, true)
174}
175
176/// Like [`diff`] but skips the heuristic that converts positional shifts
177/// into `Replace` operations.

Callers 9

newMethod · 0.70
diff_with_optionsFunction · 0.70
diff_textFunction · 0.70
diff_with_separatorFunction · 0.70
merge_textFunction · 0.70
compare_contentFunction · 0.50
demo_multiline_diffFunction · 0.50

Calls 1

diff_with_optionsFunction · 0.85