diff options
| author | bors <bors@rust-lang.org> | 2022-06-27 06:08:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-06-27 06:08:00 +0000 |
| commit | 6b762ee330a1f6f366d2316aa999a541663bce1d (patch) | |
| tree | bedacc34596b011ba502753ea4a2489a152faba4 | |
| parent | 57e7e1d7d8a90f75228aa247d6d9fdbb6b4d70d6 (diff) | |
| parent | 16919143e449336d8b64d2bb5eb25811f2897d3c (diff) | |
| download | rust-6b762ee330a1f6f366d2316aa999a541663bce1d.tar.gz rust-6b762ee330a1f6f366d2316aa999a541663bce1d.zip | |
Auto merge of #9054 - alex-semenyuk:string_add_example, r=giraffate
STRING_ADD example changelog: none STRING_ADD example, how it should be
| -rw-r--r-- | clippy_lints/src/strings.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clippy_lints/src/strings.rs b/clippy_lints/src/strings.rs index 71f3e6b6a6e..eb704a07451 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 mut x = "Hello".to_owned(); + /// x.push_str(", World"); + /// ``` #[clippy::version = "pre 1.29.0"] pub STRING_ADD, restriction, |
