diff options
Diffstat (limited to 'src/tools/clippy/src/docs/collapsible_str_replace.txt')
-rw-r--r-- | src/tools/clippy/src/docs/collapsible_str_replace.txt | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/tools/clippy/src/docs/collapsible_str_replace.txt b/src/tools/clippy/src/docs/collapsible_str_replace.txt deleted file mode 100644 index c24c25a30..000000000 --- a/src/tools/clippy/src/docs/collapsible_str_replace.txt +++ /dev/null @@ -1,19 +0,0 @@ -### What it does -Checks for consecutive calls to `str::replace` (2 or more) -that can be collapsed into a single call. - -### Why is this bad? -Consecutive `str::replace` calls scan the string multiple times -with repetitive code. - -### Example -``` -let hello = "hesuo worpd" - .replace('s', "l") - .replace("u", "l") - .replace('p', "l"); -``` -Use instead: -``` -let hello = "hesuo worpd".replace(&['s', 'u', 'p'], "l"); -```
\ No newline at end of file |