summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/unnecessary_flat_map.rs
blob: 393b95692554ca200ab9e5ac37f998e350f37d99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// run-rustfix

#![allow(unused_imports)]
#![warn(clippy::flat_map_identity)]

use std::convert;

fn main() {
    let iterator = [[0, 1], [2, 3], [4, 5]].iter();
    let _ = iterator.flat_map(|x| x);

    let iterator = [[0, 1], [2, 3], [4, 5]].iter();
    let _ = iterator.flat_map(convert::identity);
}