We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 25f2dff + 8e36d54 commit 383e7e9Copy full SHA for 383e7e9
rustfmt-core/src/comment.rs
@@ -466,7 +466,7 @@ fn rewrite_comment_inner(
466
}
467
468
result.push_str(closer);
469
- if result == opener && result.ends_with(' ') {
+ if result.ends_with(opener) && opener.ends_with(' ') {
470
// Trailing space.
471
result.pop();
472
rustfmt-core/tests/target/issue-2346.rs
@@ -0,0 +1,4 @@
1
+// rustfmt-normalize_comments: true
2
+// the following empty comment should not have any trailing space added.
3
+//
4
+fn main() {}
0 commit comments