Update main readme example

This commit is contained in:
Armin Ronacher 2021-02-06 21:45:34 +01:00
parent 4d87fe7495
commit af25a2d21b

View file

@ -19,8 +19,7 @@ fn main() {
"Hallo Welt\nThis is the second line.\nThis is life.\nMoar and more", "Hallo Welt\nThis is the second line.\nThis is life.\nMoar and more",
); );
for op in diff.ops() { for change in diff.iter_all_changes() {
for change in diff.iter_changes(op) {
let sign = match change.tag() { let sign = match change.tag() {
ChangeTag::Delete => "-", ChangeTag::Delete => "-",
ChangeTag::Insert => "+", ChangeTag::Insert => "+",
@ -28,7 +27,6 @@ fn main() {
}; };
print!("{}{}", sign, change); print!("{}{}", sign, change);
} }
}
} }
``` ```