]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/map_collect_result_unit.fixed
Rollup merge of #86828 - lambinoo:67441-const-fn-copied-take-replace, r=joshtriplett
[rust.git] / src / tools / clippy / tests / ui / map_collect_result_unit.fixed
1 // run-rustfix
2 #![warn(clippy::map_collect_result_unit)]
3
4 fn main() {
5     {
6         let _ = (0..3).try_for_each(|t| Err(t + 1));
7         let _: Result<(), _> = (0..3).try_for_each(|t| Err(t + 1));
8
9         let _ = (0..3).try_for_each(|t| Err(t + 1));
10     }
11 }
12
13 fn _ignore() {
14     let _ = (0..3).map(|t| Err(t + 1)).collect::<Result<Vec<i32>, _>>();
15     let _ = (0..3).map(|t| Err(t + 1)).collect::<Vec<Result<(), _>>>();
16 }