From fae19a9a79ad275af9e9f2ee5ad15404a9a1bbf7 Mon Sep 17 00:00:00 2001 From: koka Date: Mon, 26 Dec 2022 01:51:46 +0900 Subject: [PATCH] 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. --- clippy_lints/src/utils/internal_lints/metadata_collector.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/utils/internal_lints/metadata_collector.rs b/clippy_lints/src/utils/internal_lints/metadata_collector.rs index 857abe77e21..929544cd69d 100644 --- a/clippy_lints/src/utils/internal_lints/metadata_collector.rs +++ b/clippy_lints/src/utils/internal_lints/metadata_collector.rs @@ -558,8 +558,8 @@ impl fmt::Display for ClippyConfiguration { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> fmt::Result { writeln!( f, - "* `{}`: `{}`: {} (defaults to `{}`)", - self.name, self.config_type, self.doc, self.default + "* `{}`: `{}`(defaults to `{}`): {}", + self.name, self.config_type, self.default, self.doc ) } }