Skip to content

Commit 712e8f4

Browse files
Fix broken list for lints config
1 parent f7db895 commit 712e8f4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

clippy_config/src/metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ impl fmt::Display for ClippyConfiguration {
1313
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1414
write!(f, "- `{}`: {}", self.name, self.doc)?;
1515
if !self.default.is_empty() {
16-
write!(f, "\n\n(default: `{}`)", self.default)?;
16+
write!(f, "\n\n (default: `{}`)", self.default)?;
1717
}
1818
Ok(())
1919
}

clippy_lints/src/utils/internal_lints/metadata_collector.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,11 @@ fn cleanup_docs(docs_collection: &Vec<String>) -> String {
684684
.find(|&s| !matches!(s, "" | "ignore" | "no_run" | "should_panic"))
685685
// if no language is present, fill in "rust"
686686
.unwrap_or("rust");
687+
let len_diff = line.len() - line.trim_start().len();
688+
if len_diff != 0 {
689+
// We put back the indentation.
690+
docs.push_str(&line[..len_diff]);
691+
}
687692
docs.push_str("```");
688693
docs.push_str(lang);
689694

0 commit comments

Comments
 (0)