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

Function semantic_diff

atomic-core/src/diff/semantic/diff_impl.rs:32–34  ·  view source on GitHub ↗

Compute a semantic diff between two byte slices. This is the main entry point for semantic diffing. It: 1. Splits content into lines 2. Computes line-level diff 3. For modified lines, computes token-level diff # Arguments `old` - The original content `new` - The modified content # Returns A [`SemanticDiff`] with line and token level changes. # Example ```rust use atomic_core::diff::semantic

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

Source from the content-addressed store, hash-verified

30/// assert!(diff.has_changes());
31/// ```
32pub fn semantic_diff<'a>(old: &'a [u8], new: &'a [u8]) -> SemanticDiff<'a> {
33 semantic_diff_with_config(old, new, &SemanticDiffConfig::default())
34}
35
36/// Compute a semantic diff with custom configuration.
37///

Calls 1