fix: backport fix for #4020

This commit is contained in:
Caleb Cartwright 2020-06-11 23:17:38 -05:00
parent 0767a09c31
commit 5db7152962
2 changed files with 15 additions and 4 deletions

View File

@ -91,8 +91,9 @@ impl<'a> CommentStyle<'a> {
| CommentStyle::TripleSlash
| CommentStyle::Custom(..)
| CommentStyle::Doc => "",
CommentStyle::DoubleBullet => " **/",
CommentStyle::SingleBullet | CommentStyle::Exclamation => " */",
CommentStyle::SingleBullet | CommentStyle::DoubleBullet | CommentStyle::Exclamation => {
" */"
}
}
}
@ -101,8 +102,9 @@ impl<'a> CommentStyle<'a> {
CommentStyle::DoubleSlash => "// ",
CommentStyle::TripleSlash => "/// ",
CommentStyle::Doc => "//! ",
CommentStyle::SingleBullet | CommentStyle::Exclamation => " * ",
CommentStyle::DoubleBullet => " ** ",
CommentStyle::SingleBullet | CommentStyle::DoubleBullet | CommentStyle::Exclamation => {
" * "
}
CommentStyle::Custom(opener) => opener,
}
}

View File

@ -0,0 +1,9 @@
// rustfmt-wrap_comments: true
/** foobar */
const foo1: u32 = 0;
/**
* foobar
*/
const foo2: u32 = 0;