2023-04-23 06:03:09 -05:00
|
|
|
//@run-rustfix
|
2020-11-05 07:29:48 -06:00
|
|
|
#![warn(clippy::map_collect_result_unit)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
{
|
|
|
|
let _ = (0..3).map(|t| Err(t + 1)).collect::<Result<(), _>>();
|
|
|
|
let _: Result<(), _> = (0..3).map(|t| Err(t + 1)).collect();
|
|
|
|
|
|
|
|
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<(), _>>>();
|
|
|
|
}
|