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

Function word_diff

atomic-core/src/diff/word.rs:552–554  ·  view source on GitHub ↗

Compute word-level diff between two byte slices. This is the main entry point for word-level diffing. It tokenizes both inputs and computes the optimal edit sequence. # Arguments `old` - The original content `new` - The modified content # Returns A `WordDiffResult` containing the diff operations and token references. # Example ```rust use atomic_core::diff::word::word_diff; let old = b"con

(old: &'a [u8], new: &'a [u8])

Source from the content-addressed store, hash-verified

550/// assert!(result.has_changes());
551/// ```
552pub fn word_diff<'a>(old: &'a [u8], new: &'a [u8]) -> WordDiffResult<'a> {
553 word_diff_with_config(old, new, &WordDiffConfig::default())
554}
555
556/// Compute word-level diff with custom configuration.
557///

Calls 1

word_diff_with_configFunction · 0.85