]> git.lizzy.rs Git - rust.git/commitdiff
Remove extra whitespace after macro calls
authorEdward Yang <edward.yang6771@gmail.com>
Thu, 27 Oct 2016 07:40:08 +0000 (02:40 -0500)
committerEdward Yang <edward.yang6771@gmail.com>
Thu, 27 Oct 2016 07:40:08 +0000 (02:40 -0500)
src/missed_spans.rs
tests/source/issue-1192.rs [new file with mode: 0644]
tests/target/issue-1192.rs [new file with mode: 0644]

index 98d87ba4963c61d7794ec07349927c9882a79a5a..b49686d40a6893ad70879aa5eb71f7dd4617784f 100644 (file)
@@ -178,6 +178,13 @@ fn replace_chars(string: &str) -> String {
                     if last_wspace.is_none() {
                         last_wspace = Some(i);
                     }
+                } else if c == ';' {
+                    if last_wspace.is_some() {
+                        line_start = i;
+                    }
+
+                    rewrite_next_comment = rewrite_next_comment || kind == CodeCharKind::Normal;
+                    last_wspace = None;
                 } else {
                     rewrite_next_comment = rewrite_next_comment || kind == CodeCharKind::Normal;
                     last_wspace = None;
diff --git a/tests/source/issue-1192.rs b/tests/source/issue-1192.rs
new file mode 100644 (file)
index 0000000..4e39fbf
--- /dev/null
@@ -0,0 +1,3 @@
+fn main() {
+    assert!(true)   ;
+}
diff --git a/tests/target/issue-1192.rs b/tests/target/issue-1192.rs
new file mode 100644 (file)
index 0000000..432fe8c
--- /dev/null
@@ -0,0 +1,3 @@
+fn main() {
+    assert!(true);
+}