From 4065702b1fa6f6dc990d8bbe21da1b81885138e4 Mon Sep 17 00:00:00 2001 From: alexey semenyuk Date: Sun, 26 Jun 2022 11:14:37 +0300 Subject: [PATCH 1/2] STRING_ADD example --- clippy_lints/src/strings.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clippy_lints/src/strings.rs b/clippy_lints/src/strings.rs index 71f3e6b6a..3f9f56c45 100644 --- a/clippy_lints/src/strings.rs +++ b/clippy_lints/src/strings.rs @@ -60,6 +60,12 @@ declare_clippy_lint! { /// let x = "Hello".to_owned(); /// x + ", World"; /// ``` + /// + /// Use instead: + /// ```rust + /// let x = "Hello".to_owned(); + /// x.push_str(", World"); + /// ``` #[clippy::version = "pre 1.29.0"] pub STRING_ADD, restriction, From 16919143e449336d8b64d2bb5eb25811f2897d3c Mon Sep 17 00:00:00 2001 From: alexey semenyuk Date: Sun, 26 Jun 2022 08:36:50 +0000 Subject: [PATCH 2/2] STRING_ADD example --- clippy_lints/src/strings.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/strings.rs b/clippy_lints/src/strings.rs index 3f9f56c45..eb704a074 100644 --- a/clippy_lints/src/strings.rs +++ b/clippy_lints/src/strings.rs @@ -63,7 +63,7 @@ declare_clippy_lint! { /// /// Use instead: /// ```rust - /// let x = "Hello".to_owned(); + /// let mut x = "Hello".to_owned(); /// x.push_str(", World"); /// ``` #[clippy::version = "pre 1.29.0"]