fix: backport fix for #4020
This commit is contained in:
parent
0767a09c31
commit
5db7152962
@ -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,
|
||||
}
|
||||
}
|
||||
|
9
tests/target/issue-4020.rs
Normal file
9
tests/target/issue-4020.rs
Normal file
@ -0,0 +1,9 @@
|
||||
// rustfmt-wrap_comments: true
|
||||
|
||||
/** foobar */
|
||||
const foo1: u32 = 0;
|
||||
|
||||
/**
|
||||
* foobar
|
||||
*/
|
||||
const foo2: u32 = 0;
|
Loading…
x
Reference in New Issue
Block a user