2020-11-05 07:29:48 -06:00
|
|
|
error: `.map().collect()` can be replaced with `.try_for_each()`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/map_collect_result_unit.rs:5:17
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
LL | let _ = (0..3).map(|t| Err(t + 1)).collect::<Result<(), _>>();
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(0..3).try_for_each(|t| Err(t + 1))`
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
= note: `-D clippy::map-collect-result-unit` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::map_collect_result_unit)]`
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
error: `.map().collect()` can be replaced with `.try_for_each()`
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/map_collect_result_unit.rs:6:32
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
LL | let _: Result<(), _> = (0..3).map(|t| Err(t + 1)).collect();
|
2023-07-17 03:19:29 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(0..3).try_for_each(|t| Err(t + 1))`
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|