diff options
| author | bors <bors@rust-lang.org> | 2024-10-26 18:48:12 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-10-26 18:48:12 +0000 |
| commit | 3caff9962bdfbab049a971b9e6200f8dce34e577 (patch) | |
| tree | 94bc01a6b7e4b043fd873268e409a06732d4710b | |
| parent | 9cf416dc6ec9d7ebc8df299ca970e4a92efa2596 (diff) | |
| parent | 2666ed6c5bb1ba672ed1132737cf8e0870e2e9e9 (diff) | |
| download | rust-3caff9962bdfbab049a971b9e6200f8dce34e577.tar.gz rust-3caff9962bdfbab049a971b9e6200f8dce34e577.zip | |
Auto merge of #13571 - Alexendoo:website-code-indent, r=Centri3
Fix indentation of website code snippets Fixes #13568 Follow up to #13359, I didn't catch that it swapped the `strip_prefix` out for a `trim` but they aren't interchangeable here changelog: none
| -rw-r--r-- | clippy_config/src/conf.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clippy_config/src/conf.rs b/clippy_config/src/conf.rs index 550a6310d57..b0faac6d2a8 100644 --- a/clippy_config/src/conf.rs +++ b/clippy_config/src/conf.rs @@ -103,7 +103,9 @@ pub fn sanitize_explanation(raw_docs: &str) -> String { // Remove tags and hidden code: let mut explanation = String::with_capacity(128); let mut in_code = false; - for line in raw_docs.lines().map(str::trim) { + for line in raw_docs.lines() { + let line = line.strip_prefix(' ').unwrap_or(line); + if let Some(lang) = line.strip_prefix("```") { let tag = lang.split_once(',').map_or(lang, |(left, _)| left); if !in_code && matches!(tag, "" | "rust" | "ignore" | "should_panic" | "no_run" | "compile_fail") { |
