about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/map_collect_result_unit.fixed
blob: 26957e59f14ae2a5ccfe4be6b5982d67135ef824 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![warn(clippy::map_collect_result_unit)]

fn main() {
    {
        let _ = (0..3).try_for_each(|t| Err(t + 1));
        //~^ map_collect_result_unit
        let _: Result<(), _> = (0..3).try_for_each(|t| Err(t + 1));
        //~^ map_collect_result_unit

        let _ = (0..3).try_for_each(|t| Err(t + 1));
    }
}

fn _ignore() {
    let _ = (0..3).map(|t| Err(t + 1)).collect::<Result<Vec<i32>, _>>();
    let _ = (0..3).map(|t| Err(t + 1)).collect::<Vec<Result<(), _>>>();
}