From 2bc03e5929facc8191c8dc2bd6600fd1f46aeed0 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sun, 28 Jul 2019 15:34:17 -0400 Subject: LinePair format method --- src/edits.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/edits.rs') diff --git a/src/edits.rs b/src/edits.rs index 2eb1e0d3..734fc952 100644 --- a/src/edits.rs +++ b/src/edits.rs @@ -124,6 +124,23 @@ mod line_pair { } } + #[allow(dead_code)] + pub fn format(&self) -> String { + format!( + "LinePair\n \ + \t{} {} {}\n \ + \t{} {} {}\n \ + \t{}", + self.minus_line.trim_end(), + self.minus_edit.start, + self.minus_edit.end, + self.plus_line.trim_end(), + self.plus_edit.start, + self.plus_edit.end, + self.distance + ) + } + /// Align the two strings at their left ends and consider only the bytes up to the length of /// the shorter string. Return the byte offset of the first differing grapheme cluster, or /// the byte length of shorter string if they do not differ. -- cgit v1.2.3