From 8e36d542024935eb805b1b082fb77d0700327aa7 Mon Sep 17 00:00:00 2001 From: Johannes Linke Date: Sun, 18 Feb 2018 12:47:42 +0100 Subject: Fix #2346: empty comments should not have any trailing space added --- rustfmt-core/src/comment.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'rustfmt-core/src') 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(); } -- cgit 1.4.1-3-g733a5