]> git.lizzy.rs Git - rust.git/commitdiff
prevent bogus whitespace error messages due to \r
authorOliver Schneider <git1984941651981@oli-obk.de>
Mon, 4 May 2015 12:32:48 +0000 (14:32 +0200)
committerOliver Schneider <git1984941651981@oli-obk.de>
Mon, 4 May 2015 12:32:48 +0000 (14:32 +0200)
src/lib.rs

index cf191f04f95d3642567071868c15ce46f48a18bc..34a801dd36935de9ba631dcc8eca90474c9a952d 100644 (file)
@@ -127,7 +127,8 @@ fn fmt_lines(changes: &mut ChangeSet) {
         let mut cur_line = 1;
         let mut newline_count = 0;
         for (c, b) in text.chars() {
-            if c == '\n' { // TOOD test for \r too
+            if c == '\r' { continue; }
+            if c == '\n' {
                 // Check for (and record) trailing whitespace.
                 if let Some(lw) = last_wspace {
                     trims.push((cur_line, lw, b));