about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/map_collect_result_unit.stderr
blob: 93293be855bb02af685be255a55743de178c2f14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
error: `.map().collect()` can be replaced with `.try_for_each()`
  --> tests/ui/map_collect_result_unit.rs:5:17
   |
LL |         let _ = (0..3).map(|t| Err(t + 1)).collect::<Result<(), _>>();
   |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(0..3).try_for_each(|t| Err(t + 1))`
   |
   = note: `-D clippy::map-collect-result-unit` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::map_collect_result_unit)]`

error: `.map().collect()` can be replaced with `.try_for_each()`
  --> tests/ui/map_collect_result_unit.rs:7:32
   |
LL |         let _: Result<(), _> = (0..3).map(|t| Err(t + 1)).collect();
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(0..3).try_for_each(|t| Err(t + 1))`

error: aborting due to 2 previous errors