Add unified diff and tests for it

This commit is contained in:
Dima Kudosh
2016-02-28 18:24:03 +03:00
parent 2d309c0ba4
commit 0fa2c80be0
4 changed files with 24 additions and 34 deletions
+1
View File
@@ -27,6 +27,7 @@ pub fn count_leading(line: &str, c: char) -> usize {
pub fn format_range_unified(start:usize, end: usize) -> String {
let mut beginning = start + 1;
println!("{:?} {}", start, end);
let length = end - start;
if length == 1 {
return format!("{}", beginning)