Skip to content

Commit 3caff99

Browse files
committed
Auto merge of rust-lang#13571 - Alexendoo:website-code-indent, r=Centri3
Fix indentation of website code snippets Fixes rust-lang#13568 Follow up to rust-lang#13359, I didn't catch that it swapped the `strip_prefix` out for a `trim` but they aren't interchangeable here changelog: none
2 parents 9cf416d + 2666ed6 commit 3caff99

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
@@ -103,7 +103,9 @@ pub fn sanitize_explanation(raw_docs: &str) -> String {
103103
// Remove tags and hidden code:
104104
let mut explanation = String::with_capacity(128);
105105
let mut in_code = false;
106-
for line in raw_docs.lines().map(str::trim) {
106+
for line in raw_docs.lines() {
107+
let line = line.strip_prefix(' ').unwrap_or(line);
108+
107109
if let Some(lang) = line.strip_prefix("```") {
108110
let tag = lang.split_once(',').map_or(lang, |(left, _)| left);
109111
if !in_code && matches!(tag, "" | "rust" | "ignore" | "should_panic" | "no_run" | "compile_fail") {

0 commit comments

Comments
 (0)