Skip to content

Commit 266eef7

Browse files
committed
Auto merge of #10119 - koka831:doc/config-default-value, r=xFrednet
fix codeblocks in the document While I've looked into rust-lang/rust-clippy#9990, I found broken code blocks in the document. This patch not only improves visibility, but also fixes a potential bug. When a lint description ends with code block, the string will have three backquotes at the end. Since the current implementation prints the default value immediately after that, the markdown renderer is unable to properly close the code block. e.g. `arithmetic_side_effects`, we can see code block is not rendered properly, and (I think) it's bit hard to understand what ``"defaults to `[]`"`` is meant. ![2022-12-26_01-51](https://user-images.githubusercontent.com/14945055/209476342-4d0b2e18-44b6-4c74-8c3c-4f4f0904e8ca.png) In this PR, it will be rendered as: ![image](https://user-images.githubusercontent.com/14945055/209476353-07587b86-1100-445f-946d-41f62f741e51.png) changelog: none r? `@xFrednet`
2 parents d98e714 + fae19a9 commit 266eef7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/utils/internal_lints/metadata_collector.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,8 @@ impl fmt::Display for ClippyConfiguration {
558558
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> fmt::Result {
559559
writeln!(
560560
f,
561-
"* `{}`: `{}`: {} (defaults to `{}`)",
562-
self.name, self.config_type, self.doc, self.default
561+
"* `{}`: `{}`(defaults to `{}`): {}",
562+
self.name, self.config_type, self.default, self.doc
563563
)
564564
}
565565
}

0 commit comments

Comments
 (0)