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

Function word_diff_str

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

Compute word-level diff between two strings. Convenience function for string inputs. # Example ```rust use atomic_core::diff::word::word_diff_str; let result = word_diff_str("hello world", "hello there"); assert!(result.has_changes()); ```

(old: &'a str, new: &'a str)

Source from the content-addressed store, hash-verified

850/// assert!(result.has_changes());
851/// ```
852pub fn word_diff_str<'a>(old: &'a str, new: &'a str) -> WordDiffResult<'a> {
853 word_diff(old.as_bytes(), new.as_bytes())
854}
855
856// Tests
857

Callers 2

test_word_diff_strFunction · 0.85

Calls 2

word_diffFunction · 0.85
as_bytesMethod · 0.45

Tested by 2

test_word_diff_strFunction · 0.68