]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/map_collect_result_unit.stderr
Merge commit 'a8385522ade6f67853edac730b5bf164ddb298fd' into simd-remove-autosplats
[rust.git] / src / tools / clippy / tests / ui / map_collect_result_unit.stderr
1 error: `.map().collect()` can be replaced with `.try_for_each()`
2   --> $DIR/map_collect_result_unit.rs:6:17
3    |
4 LL |         let _ = (0..3).map(|t| Err(t + 1)).collect::<Result<(), _>>();
5    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `(0..3).try_for_each(|t| Err(t + 1))`
6    |
7    = note: `-D clippy::map-collect-result-unit` implied by `-D warnings`
8
9 error: `.map().collect()` can be replaced with `.try_for_each()`
10   --> $DIR/map_collect_result_unit.rs:7:32
11    |
12 LL |         let _: Result<(), _> = (0..3).map(|t| Err(t + 1)).collect();
13    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `(0..3).try_for_each(|t| Err(t + 1))`
14
15 error: aborting due to 2 previous errors
16