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 db06867 commit bd8c8d9Copy full SHA for bd8c8d9
crates/fmt/src/state/mod.rs
@@ -602,7 +602,7 @@ impl<'sess> State<'sess, '_> {
602
603
let content = &line[prefix.len()..];
604
let content = if is_doc {
605
- // Doc comments: emit ALL leading whitespace as breaking spaces to preserve formatting
+ // Doc comments preserve leading whitespaces (right after the prefix) as nbps.
606
let ws_len = content.chars().take_while(|&c| c.is_whitespace()).count();
607
let (leading_ws, rest) = content.split_at(ws_len);
608
if !leading_ws.is_empty() {
0 commit comments