Added slice remapper and improved documentation (#8)
* Experimental slice remapper * Added iter_slices to DiffOp * Improvements to the utility diff functions * Documentation improvements * More documentation updates on utils * More documentation on main text diff
This commit is contained in:
parent
81ef0b1adc
commit
777105fbb0
6 changed files with 668 additions and 16 deletions
11
examples/original-slices.rs
Normal file
11
examples/original-slices.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
use similar::utils::diff_chars;
|
||||
use similar::Algorithm;
|
||||
|
||||
fn main() {
|
||||
let old = "1234567890abcdef".to_string();
|
||||
let new = "0123456789Oabzdef".to_string();
|
||||
|
||||
for (change_tag, value) in diff_chars(Algorithm::Myers, &old, &new) {
|
||||
println!("{}{:?}", change_tag, value);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue