2022-03-24 08:50:04 -05:00
|
|
|
#![warn(clippy::unnecessary_join)]
|
2023-07-02 07:35:19 -05:00
|
|
|
#![allow(clippy::uninlined_format_args, clippy::useless_vec)]
|
2022-03-24 08:50:04 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// should be linted
|
|
|
|
let vector = vec!["hello", "world"];
|
|
|
|
let output = vector
|
|
|
|
.iter()
|
|
|
|
.map(|item| item.to_uppercase())
|
|
|
|
.collect::<Vec<String>>()
|
|
|
|
.join("");
|
|
|
|
println!("{}", output);
|
|
|
|
|
|
|
|
// should be linted
|
|
|
|
let vector = vec!["hello", "world"];
|
|
|
|
let output = vector
|
|
|
|
.iter()
|
|
|
|
.map(|item| item.to_uppercase())
|
|
|
|
.collect::<Vec<_>>()
|
|
|
|
.join("");
|
|
|
|
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);
|
|
|
|
}
|