From 3aae785693881ab01850809e6aa121e61c46385b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Fri, 30 Dec 2022 16:10:07 +0200 Subject: [PATCH 1/2] Avoid useless format --- crates/ide-completion/src/render/variant.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ide-completion/src/render/variant.rs b/crates/ide-completion/src/render/variant.rs index 5995da68a165..f3e88489f46d 100644 --- a/crates/ide-completion/src/render/variant.rs +++ b/crates/ide-completion/src/render/variant.rs @@ -49,7 +49,7 @@ pub(crate) fn render_tuple_lit( path: &str, ) -> RenderedLiteral { if snippet_cap.is_none() { - return RenderedLiteral { literal: format!("{path}"), detail: format!("{path}") }; + return RenderedLiteral { literal: path.to_string(), detail: path.to_string() }; } let completions = fields.iter().enumerate().format_with(", ", |(idx, _), f| { if snippet_cap.is_some() { From d96c489120551d36f5bdb362ce313052350821f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Fri, 30 Dec 2022 16:10:17 +0200 Subject: [PATCH 2/2] Rephrase clippy policy --- docs/dev/style.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/style.md b/docs/dev/style.md index a80eebd63296..d2a03fba40d4 100644 --- a/docs/dev/style.md +++ b/docs/dev/style.md @@ -101,7 +101,7 @@ Including a description and GIF suitable for the changelog means less work for t We don't enforce Clippy. A number of default lints have high false positive rate. -Selectively patching false-positives with `allow(clippy)` is considered worse than not using Clippy at all. +Selectively patching false-positives with `allow(clippy)` is probably worse than entirely disabling a problematic lint. There's a `cargo lint` command which runs a subset of low-FPR lints. Careful tweaking of `lint` is welcome. Of course, applying Clippy suggestions is welcome as long as they indeed improve the code.