From af25a2d21b59be937226be8a3eb16a80f253969a Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Sat, 6 Feb 2021 21:45:34 +0100 Subject: [PATCH] Update main readme example --- README.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e4f7140..b44022b 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,13 @@ fn main() { "Hallo Welt\nThis is the second line.\nThis is life.\nMoar and more", ); - for op in diff.ops() { - for change in diff.iter_changes(op) { - let sign = match change.tag() { - ChangeTag::Delete => "-", - ChangeTag::Insert => "+", - ChangeTag::Equal => " ", - }; - print!("{}{}", sign, change); - } + for change in diff.iter_all_changes() { + let sign = match change.tag() { + ChangeTag::Delete => "-", + ChangeTag::Insert => "+", + ChangeTag::Equal => " ", + }; + print!("{}{}", sign, change); } } ```