mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 01:17:16 +00:00
92 lines
4.2 KiB
Text
92 lines
4.2 KiB
Text
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:18:27
|
|
|
|
|
LL | let _ = "hesuo worpd".replace('s', "l").replace('u', "l");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['s', 'u'], "l")`
|
|
|
|
|
= note: `-D clippy::collapsible-str-replace` implied by `-D warnings`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:20:27
|
|
|
|
|
LL | let _ = "hesuo worpd".replace('s', l).replace('u', l);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['s', 'u'], l)`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:22:27
|
|
|
|
|
LL | let _ = "hesuo worpd".replace('s', "l").replace('u', "l").replace('p', "l");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['s', 'u', 'p'], "l")`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:25:10
|
|
|
|
|
LL | .replace('s', "l")
|
|
| __________^
|
|
LL | | .replace('u', "l")
|
|
LL | | .replace('p', "l")
|
|
LL | | .replace('d', "l");
|
|
| |__________________________^ help: replace with: `replace(['s', 'u', 'p', 'd'], "l")`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:30:27
|
|
|
|
|
LL | let _ = "hesuo world".replace(s, "l").replace('u', "l");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace([s, 'u'], "l")`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:32:27
|
|
|
|
|
LL | let _ = "hesuo worpd".replace(s, "l").replace('u', "l").replace('p', "l");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace([s, 'u', 'p'], "l")`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:34:27
|
|
|
|
|
LL | let _ = "hesuo worpd".replace(s, "l").replace(u, "l").replace('p', "l");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace([s, u, 'p'], "l")`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:36:27
|
|
|
|
|
LL | let _ = "hesuo worpd".replace(s, "l").replace(u, "l").replace(p, "l");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace([s, u, p], "l")`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:38:27
|
|
|
|
|
LL | let _ = "hesuo worlp".replace('s', "l").replace('u', "l").replace('p', "d");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['s', 'u'], "l")`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:40:45
|
|
|
|
|
LL | let _ = "hesuo worpd".replace('s', "x").replace('u', "l").replace('p', "l");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['u', 'p'], "l")`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:43:47
|
|
|
|
|
LL | let _ = "hesudo worpd".replace("su", "l").replace('d', "l").replace('p', "l");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['d', 'p'], "l")`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:45:28
|
|
|
|
|
LL | let _ = "hesudo worpd".replace(d, "l").replace('p', "l").replace("su", "l");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace([d, 'p'], "l")`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:47:27
|
|
|
|
|
LL | let _ = "hesuo world".replace(get_filter(), "l").replace('s', "l");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace([get_filter(), 's'], "l")`
|
|
|
|
error: used consecutive `str::replace` call
|
|
--> $DIR/collapsible_str_replace.rs:84:16
|
|
|
|
|
LL | let _ = "".replace('a', "1.58").replace('b', "1.58");
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['a', 'b'], "1.58")`
|
|
|
|
error: aborting due to 14 previous errors
|
|
|