Skip to content

Commit fae19a9

Browse files
committed
Place default values near its definitions
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.
1 parent 4f1bae0 commit fae19a9

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)