|
| 1 | +error: unnecessary use of `to_string` |
| 2 | + --> $DIR/unnecessary_to_owned_on_split.rs:4:13 |
| 3 | + | |
| 4 | +LL | let _ = "a".to_string().split('a').next().unwrap(); |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"a".split('a')` |
| 6 | + | |
| 7 | + = note: `-D clippy::unnecessary-to-owned` implied by `-D warnings` |
| 8 | + = help: to override `-D warnings` add `#[allow(clippy::unnecessary_to_owned)]` |
| 9 | + |
| 10 | +error: unnecessary use of `to_string` |
| 11 | + --> $DIR/unnecessary_to_owned_on_split.rs:6:13 |
| 12 | + | |
| 13 | +LL | let _ = "a".to_string().split("a").next().unwrap(); |
| 14 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"a".split("a")` |
| 15 | + |
| 16 | +error: unnecessary use of `to_owned` |
| 17 | + --> $DIR/unnecessary_to_owned_on_split.rs:8:13 |
| 18 | + | |
| 19 | +LL | let _ = "a".to_owned().split('a').next().unwrap(); |
| 20 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"a".split('a')` |
| 21 | + |
| 22 | +error: unnecessary use of `to_owned` |
| 23 | + --> $DIR/unnecessary_to_owned_on_split.rs:10:13 |
| 24 | + | |
| 25 | +LL | let _ = "a".to_owned().split("a").next().unwrap(); |
| 26 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"a".split("a")` |
| 27 | + |
| 28 | +error: unnecessary use of `to_vec` |
| 29 | + --> $DIR/unnecessary_to_owned_on_split.rs:13:13 |
| 30 | + | |
| 31 | +LL | let _ = [1].to_vec().split(|x| *x == 2).next().unwrap(); |
| 32 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[1].split(|x| *x == 2)` |
| 33 | + |
| 34 | +error: unnecessary use of `to_vec` |
| 35 | + --> $DIR/unnecessary_to_owned_on_split.rs:15:13 |
| 36 | + | |
| 37 | +LL | let _ = [1].to_vec().split(|x| *x == 2).next().unwrap(); |
| 38 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[1].split(|x| *x == 2)` |
| 39 | + |
| 40 | +error: unnecessary use of `to_owned` |
| 41 | + --> $DIR/unnecessary_to_owned_on_split.rs:17:13 |
| 42 | + | |
| 43 | +LL | let _ = [1].to_owned().split(|x| *x == 2).next().unwrap(); |
| 44 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[1].split(|x| *x == 2)` |
| 45 | + |
| 46 | +error: unnecessary use of `to_owned` |
| 47 | + --> $DIR/unnecessary_to_owned_on_split.rs:19:13 |
| 48 | + | |
| 49 | +LL | let _ = [1].to_owned().split(|x| *x == 2).next().unwrap(); |
| 50 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[1].split(|x| *x == 2)` |
| 51 | + |
| 52 | +error: aborting due to 8 previous errors |
| 53 | + |
0 commit comments