diff options
| author | bors <bors@rust-lang.org> | 2024-07-31 11:11:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-07-31 11:11:39 +0000 |
| commit | ea06fa326d57da2ec9c018e189a31c6beb8ee4cd (patch) | |
| tree | c24c71b0e3a8171c4d53aed6253d5206d6aaaf01 /clippy_lints/src | |
| parent | c6f45df3c173456dab6b73e3660cda1c9d3683ee (diff) | |
| parent | 712e8f4f48ad64fc33bc759c82cbe0d3cacb1d0f (diff) | |
Auto merge of #13177 - GuillaumeGomez:fix-broken-list-lints-config, r=xFrednet
Fix broken list for lints config Follow-up of #13166. Finally figured out that it was a transformation and not the source that was the problem. It now looks like this:  r? `@xFrednet` changelog: none
Diffstat (limited to 'clippy_lints/src')
| -rw-r--r-- | clippy_lints/src/utils/internal_lints/metadata_collector.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clippy_lints/src/utils/internal_lints/metadata_collector.rs b/clippy_lints/src/utils/internal_lints/metadata_collector.rs index b5a772e7a81..2fc66c56036 100644 --- a/clippy_lints/src/utils/internal_lints/metadata_collector.rs +++ b/clippy_lints/src/utils/internal_lints/metadata_collector.rs @@ -684,6 +684,11 @@ fn cleanup_docs(docs_collection: &Vec<String>) -> String { .find(|&s| !matches!(s, "" | "ignore" | "no_run" | "should_panic")) // if no language is present, fill in "rust" .unwrap_or("rust"); + let len_diff = line.len() - line.trim_start().len(); + if len_diff != 0 { + // We put back the indentation. + docs.push_str(&line[..len_diff]); + } docs.push_str("```"); docs.push_str(lang); |
