The IterDiff
trait can be used to iterate through the differences between
two iterators. The differences between each element are enumerated by Diff
.
The variants of the enum express the changes one would need to make to the
left-hand iterator in order to attain the right-hand iterator.
```rust use iter_diff::prelude::*;
let a = [0, 1, 2, 3]; let b = [0, 2, 2];
let diffs: Vec<_> = a.iterdiff(b).collect(); asserteq!(diffs.len(), 4);
asserteq!(diffs[0], Diff::Keep); asserteq!(diffs[1], Diff::Change(2)); asserteq!(diffs[2], Diff::Keep); asserteq!(diffs[3], Diff::Remove); ```