about summary refs log tree commit diff
path: root/rustfmt-core/src
diff options
context:
space:
mode:
authorJohannes Linke <johannes.linke@posteo.de>2018-02-18 12:47:42 +0100
committerJohannes Linke <johannes.linke@posteo.de>2018-02-18 12:50:10 +0100
commit8e36d542024935eb805b1b082fb77d0700327aa7 (patch)
tree81bbf974c5f2da756163e059b42e6df1a21ad0a6 /rustfmt-core/src
parent263104a365797151246d28e7d0d05673390a358d (diff)
Fix #2346: empty comments should not have any trailing space added
Diffstat (limited to 'rustfmt-core/src')
-rw-r--r--rustfmt-core/src/comment.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/rustfmt-core/src/comment.rs b/rustfmt-core/src/comment.rs
index 512863c88be..67678f59074 100644
--- a/rustfmt-core/src/comment.rs
+++ b/rustfmt-core/src/comment.rs
@@ -466,7 +466,7 @@ fn rewrite_comment_inner(
     }
 
     result.push_str(closer);
-    if result == opener && result.ends_with(' ') {
+    if result.ends_with(opener) && opener.ends_with(' ') {
         // Trailing space.
         result.pop();
     }