fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1#![warn(clippy::flat_map_option)] 2#![allow(clippy::redundant_closure, clippy::unnecessary_filter_map)] 3 4fn main() { 5 // yay 6 let c = |x| Some(x); 7 let _ = [1].iter().filter_map(c); 8 let _ = [1].iter().filter_map(Some); 9 10 // nay 11 let _ = [1].iter().flat_map(|_| &Some(1)); 12}