Skip to content

Commit 8919fd3

Browse files
committed
fix(comment): Prefer light_rewrite_comment if it is not a doccomment
1 parent b2da8a5 commit 8919fd3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/comment.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,11 @@ fn identify_comment(
367367
trim_left_preserve_layout(first_group, shape.indent, config)?
368368
} else if !config.normalize_comments()
369369
&& !config.wrap_comments()
370-
&& !config.format_code_in_doc_comments()
370+
&& !(
371+
// `format_code_in_doc_comments` should only take effect on doc comments,
372+
// so we only consider it when this comment block is a doc comment block.
373+
is_doc_comment && config.format_code_in_doc_comments()
374+
)
371375
{
372376
light_rewrite_comment(first_group, shape.indent, config, is_doc_comment)
373377
} else {

0 commit comments

Comments
 (0)