mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 10:07:30 +00:00
36 lines
891 B
Rust
36 lines
891 B
Rust
|
// run-rustfix
|
||
|
|
||
|
#![warn(clippy::unnecessary_join)]
|
||
|
|
||
|
fn main() {
|
||
|
// should be linted
|
||
|
let vector = vec!["hello", "world"];
|
||
|
let output = vector
|
||
|
.iter()
|
||
|
.map(|item| item.to_uppercase())
|
||
|
.collect::<String>();
|
||
|
println!("{}", output);
|
||
|
|
||
|
// should be linted
|
||
|
let vector = vec!["hello", "world"];
|
||
|
let output = vector
|
||
|
.iter()
|
||
|
.map(|item| item.to_uppercase())
|
||
|
.collect::<String>();
|
||
|
println!("{}", output);
|
||
|
|
||
|
// should not be linted
|
||
|
let vector = vec!["hello", "world"];
|
||
|
let output = vector
|
||
|
.iter()
|
||
|
.map(|item| item.to_uppercase())
|
||
|
.collect::<Vec<String>>()
|
||
|
.join("\n");
|
||
|
println!("{}", output);
|
||
|
|
||
|
// should not be linted
|
||
|
let vector = vec!["hello", "world"];
|
||
|
let output = vector.iter().map(|item| item.to_uppercase()).collect::<String>();
|
||
|
println!("{}", output);
|
||
|
}
|