mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 11:44:28 +00:00
Merge pull request #2465 from karyon/fix_2346
Fix #2346: empty comments should not have any trailing space added
This commit is contained in:
commit
383e7e9955
@ -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();
|
||||
}
|
||||
|
4
rustfmt-core/tests/target/issue-2346.rs
Normal file
4
rustfmt-core/tests/target/issue-2346.rs
Normal file
@ -0,0 +1,4 @@
|
||||
// rustfmt-normalize_comments: true
|
||||
// the following empty comment should not have any trailing space added.
|
||||
//
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user