Files
rust/tests/ui/flat_map_option.fixed
Guillaume Gomez f666fd6417 Update UI tests
2025-02-15 13:38:16 +01:00

15 lines
342 B
Rust

#![warn(clippy::flat_map_option)]
#![allow(clippy::redundant_closure, clippy::unnecessary_filter_map)]
fn main() {
// yay
let c = |x| Some(x);
let _ = [1].iter().filter_map(c);
//~^ flat_map_option
let _ = [1].iter().filter_map(Some);
//~^ flat_map_option
// nay
let _ = [1].iter().flat_map(|_| &Some(1));
}