Merge pull request #2465 from karyon/fix_2346

Fix #2346: empty comments should not have any trailing space added
This commit is contained in:
Nick Cameron 2018-02-19 11:45:49 +13:00 committed by GitHub
commit 383e7e9955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -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();
}

View File

@ -0,0 +1,4 @@
// rustfmt-normalize_comments: true
// the following empty comment should not have any trailing space added.
//
fn main() {}