2023-11-25 21:35:56 +00:00
|
|
|
error: unnecessary use of `to_string`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unnecessary_to_owned_on_split.rs:19:13
|
2023-11-25 21:35:56 +00:00
|
|
|
|
|
|
|
|
LL | let _ = "a".to_string().split('a').next().unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"a".split('a')`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-to-owned` implied by `-D warnings`
|
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_to_owned)]`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_string`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unnecessary_to_owned_on_split.rs:21:13
|
2023-11-25 21:35:56 +00:00
|
|
|
|
|
|
|
|
LL | let _ = "a".to_string().split("a").next().unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"a".split("a")`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unnecessary_to_owned_on_split.rs:23:13
|
2023-11-25 21:35:56 +00:00
|
|
|
|
|
|
|
|
LL | let _ = "a".to_owned().split('a').next().unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"a".split('a')`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unnecessary_to_owned_on_split.rs:25:13
|
2023-11-25 21:35:56 +00:00
|
|
|
|
|
|
|
|
LL | let _ = "a".to_owned().split("a").next().unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"a".split("a")`
|
|
|
|
|
2024-01-04 16:13:18 +00:00
|
|
|
error: unnecessary use of `to_string`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unnecessary_to_owned_on_split.rs:27:13
|
2024-01-04 16:13:18 +00:00
|
|
|
|
|
|
|
|
LL | let _ = Issue12068.to_string().split('a').next().unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `Issue12068.as_ref().split('a')`
|
|
|
|
|
2023-11-25 21:35:56 +00:00
|
|
|
error: unnecessary use of `to_vec`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unnecessary_to_owned_on_split.rs:30:13
|
2023-11-25 21:35:56 +00:00
|
|
|
|
|
|
|
|
LL | let _ = [1].to_vec().split(|x| *x == 2).next().unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[1].split(|x| *x == 2)`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_vec`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unnecessary_to_owned_on_split.rs:32:13
|
2023-11-25 21:35:56 +00:00
|
|
|
|
|
|
|
|
LL | let _ = [1].to_vec().split(|x| *x == 2).next().unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[1].split(|x| *x == 2)`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unnecessary_to_owned_on_split.rs:34:13
|
2023-11-25 21:35:56 +00:00
|
|
|
|
|
|
|
|
LL | let _ = [1].to_owned().split(|x| *x == 2).next().unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[1].split(|x| *x == 2)`
|
|
|
|
|
|
|
|
error: unnecessary use of `to_owned`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/unnecessary_to_owned_on_split.rs:36:13
|
2023-11-25 21:35:56 +00:00
|
|
|
|
|
|
|
|
LL | let _ = [1].to_owned().split(|x| *x == 2).next().unwrap();
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `[1].split(|x| *x == 2)`
|
|
|
|
|
2024-01-04 16:13:18 +00:00
|
|
|
error: aborting due to 9 previous errors
|
2023-11-25 21:35:56 +00:00
|
|
|
|