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

Function diff_with_separator

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

Diff two byte slices as text using a custom separator pattern. This allows diffing with custom line separators (e.g., for languages that use different conventions or for record-oriented data). # Arguments `old` - The original content `new` - The modified content `separator` - The separator to use for splitting `algorithm` - Which diff algorithm to use # Returns A [`DiffResult`] containing the

(
    old: &'a [u8],
    new: &'a [u8],
    separator: &Separator,
    algorithm: Algorithm,
)

Source from the content-addressed store, hash-verified

563///
564/// A [`DiffResult`] containing the diff operations.
565pub fn diff_with_separator<'a>(
566 old: &'a [u8],
567 new: &'a [u8],
568 separator: &Separator,
569 algorithm: Algorithm,
570) -> DiffResult {
571 let old_lines: Vec<Line> = LineSplit::new(old, separator).collect();
572 let new_lines: Vec<Line> = LineSplit::new(new, separator).collect();
573 diff(&old_lines, &new_lines, algorithm)
574}
575
576/// Three-way merge of byte content.
577///

Callers

nothing calls this directly

Calls 1

diffFunction · 0.70

Tested by

no test coverage detected