Fix broken list for lints config

This commit is contained in:
Guillaume Gomez 2024-07-29 16:30:59 +02:00
parent f7db8952e6
commit 712e8f4f48
2 changed files with 6 additions and 1 deletions

View File

@ -13,7 +13,7 @@ impl fmt::Display for ClippyConfiguration {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "- `{}`: {}", self.name, self.doc)?;
if !self.default.is_empty() {
write!(f, "\n\n(default: `{}`)", self.default)?;
write!(f, "\n\n (default: `{}`)", self.default)?;
}
Ok(())
}

View File

@ -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);