diff options
author | Dan Davison <dandavison7@gmail.com> | 2019-07-28 15:34:17 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2019-07-28 21:49:57 -0400 |
commit | 2bc03e5929facc8191c8dc2bd6600fd1f46aeed0 (patch) | |
tree | 4b59752b3b66a9a78db8798a81518014540fbb73 /src/edits.rs | |
parent | 0be75d3746915bd559b2e4185d090d4f11281470 (diff) |
LinePair format method
Diffstat (limited to 'src/edits.rs')
-rw-r--r-- | src/edits.rs | 17 |
1 files changed, 17 insertions, 0 deletions
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. |