about summary refs log tree commit diff
path: root/rustfmt-core/src/comment.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rustfmt-core/src/comment.rs')
-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();
     }