fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1#![warn(clippy::unnecessary_join)] 2#![allow(clippy::uninlined_format_args, clippy::useless_vec)] 3 4fn main() { 5 // should be linted 6 let vector = vec!["hello", "world"]; 7 let output = vector 8 .iter() 9 .map(|item| item.to_uppercase()) 10 .collect::<String>(); 11 println!("{}", output); 12 13 // should be linted 14 let vector = vec!["hello", "world"]; 15 let output = vector 16 .iter() 17 .map(|item| item.to_uppercase()) 18 .collect::<String>(); 19 println!("{}", output); 20 21 // should not be linted 22 let vector = vec!["hello", "world"]; 23 let output = vector 24 .iter() 25 .map(|item| item.to_uppercase()) 26 .collect::<Vec<String>>() 27 .join("\n"); 28 println!("{}", output); 29 30 // should not be linted 31 let vector = vec!["hello", "world"]; 32 let output = vector.iter().map(|item| item.to_uppercase()).collect::<String>(); 33 println!("{}", output); 34}