Skip to content

Commit 5ecdd07

Browse files
committed
Remove extra whitespace after macro calls
1 parent 4b1c669 commit 5ecdd07

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/missed_spans.rs

+7
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,13 @@ impl<'a> FmtVisitor<'a> {
178178
if last_wspace.is_none() {
179179
last_wspace = Some(i);
180180
}
181+
} else if c == ';' {
182+
if last_wspace.is_some() {
183+
line_start = i;
184+
}
185+
186+
rewrite_next_comment = rewrite_next_comment || kind == CodeCharKind::Normal;
187+
last_wspace = None;
181188
} else {
182189
rewrite_next_comment = rewrite_next_comment || kind == CodeCharKind::Normal;
183190
last_wspace = None;

tests/source/issue-1192.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
assert!(true) ;
3+
}

tests/target/issue-1192.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
assert!(true);
3+
}

0 commit comments

Comments
 (0)