2022-03-24 07:18:18 -05:00
|
|
|
// run-rustfix
|
|
|
|
#![warn(clippy::unnecessary_join)]
|
2022-10-02 14:13:22 -05:00
|
|
|
#![allow(clippy::uninlined_format_args)]
|
2022-03-24 07:18:18 -05:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|