Skip to content

Commit 2666ed6

Browse files
committed
Fix indentation of website code snippets
1 parent 5678531 commit 2666ed6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clippy_config/src/conf.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +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) {
105+
for line in raw_docs.lines() {
106+
let line = line.strip_prefix(' ').unwrap_or(line);
107+
106108
if let Some(lang) = line.strip_prefix("```") {
107109
let tag = lang.split_once(',').map_or(lang, |(left, _)| left);
108110
if !in_code && matches!(tag, "" | "rust" | "ignore" | "should_panic" | "no_run" | "compile_fail") {

0 commit comments

Comments
 (0)