Skip to content

Commit 479128b

Browse files
ayazhafizcalebcartwright
authored andcommitted
Remove spaces added by comment opener when creating itemized block
I'm not sure there's a better way to do this without a larger refactor of this method. Closes #4104
1 parent 61d2a1a commit 479128b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

rustfmt-core/rustfmt-lib/src/comment.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,9 @@ impl<'a> CommentRewrite<'a> {
704704
} else if self.fmt.config.wrap_comments() && ItemizedBlock::is_itemized_line(&line) {
705705
let ib = ItemizedBlock::new(&line);
706706
self.item_block = Some(ib);
707+
if self.result.ends_with(' ') {
708+
self.result.pop();
709+
}
707710
return false;
708711
}
709712

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// rustfmt-wrap_comments: true
2+
// rustfmt-normalize_comments: true
3+
4+
///
5+
/// - item 1
6+
7+
fn main() {}

0 commit comments

Comments
 (0)