We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c8781f commit d8ee7c3Copy full SHA for d8ee7c3
src/comment.rs
@@ -367,7 +367,11 @@ fn identify_comment(
367
trim_left_preserve_layout(first_group, shape.indent, config)?
368
} else if !config.normalize_comments()
369
&& !config.wrap_comments()
370
- && !config.format_code_in_doc_comments()
+ && !(
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
+ )
375
{
376
light_rewrite_comment(first_group, shape.indent, config, is_doc_comment)
377
} else {
0 commit comments