mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
22 lines
804 B
Rust
22 lines
804 B
Rust
|
#[allow(clippy::single_char_pattern)]
|
||
|
|
||
|
fn main() {
|
||
|
let _ = "a".split('a').next().unwrap();
|
||
|
//~^ ERROR: unnecessary use of `to_string`
|
||
|
let _ = "a".split("a").next().unwrap();
|
||
|
//~^ ERROR: unnecessary use of `to_string`
|
||
|
let _ = "a".split('a').next().unwrap();
|
||
|
//~^ ERROR: unnecessary use of `to_owned`
|
||
|
let _ = "a".split("a").next().unwrap();
|
||
|
//~^ ERROR: unnecessary use of `to_owned`
|
||
|
|
||
|
let _ = [1].split(|x| *x == 2).next().unwrap();
|
||
|
//~^ ERROR: unnecessary use of `to_vec`
|
||
|
let _ = [1].split(|x| *x == 2).next().unwrap();
|
||
|
//~^ ERROR: unnecessary use of `to_vec`
|
||
|
let _ = [1].split(|x| *x == 2).next().unwrap();
|
||
|
//~^ ERROR: unnecessary use of `to_owned`
|
||
|
let _ = [1].split(|x| *x == 2).next().unwrap();
|
||
|
//~^ ERROR: unnecessary use of `to_owned`
|
||
|
}
|