File: nonstring.rs

package info (click to toggle)
rust-similar 2.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 540 kB
  • sloc: makefile: 25; sh: 3
file content (13 lines) | stat: -rw-r--r-- 312 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
use similar::{capture_diff_slices, Algorithm};

fn main() {
    let old = vec![1, 2, 3];
    let new = vec![1, 2, 4];
    let ops = capture_diff_slices(Algorithm::Myers, &old, &new);

    for op in ops {
        for change in op.iter_changes(&old, &new) {
            println!("{:?}", change);
        }
    }
}