Skip to content

Commit ea4ef8e

Browse files
Fix indent in lints page
1 parent cefa31a commit ea4ef8e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clippy_config/src/conf.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,9 @@ pub fn sanitize_explanation(raw_docs: &str) -> String {
102102
// Remove tags and hidden code:
103103
let mut explanation = String::with_capacity(128);
104104
let mut in_code = false;
105-
for line in raw_docs.lines().map(str::trim) {
106-
if let Some(lang) = line.strip_prefix("```") {
105+
for line in raw_docs.lines() {
106+
let trimmed_line = line.trim();
107+
if let Some(lang) = trimmed_line.strip_prefix("```") {
107108
let tag = lang.split_once(',').map_or(lang, |(left, _)| left);
108109
if !in_code && matches!(tag, "" | "rust" | "ignore" | "should_panic" | "no_run" | "compile_fail") {
109110
explanation += "```rust\n";
@@ -112,7 +113,7 @@ pub fn sanitize_explanation(raw_docs: &str) -> String {
112113
explanation.push('\n');
113114
}
114115
in_code = !in_code;
115-
} else if !(in_code && line.starts_with("# ")) {
116+
} else if !(in_code && trimmed_line.starts_with("# ")) {
116117
explanation += line;
117118
explanation.push('\n');
118119
}

0 commit comments

Comments
 (0)