]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/map_flatten.stderr
Rollup merge of #88838 - FabianWolff:issue-88472, r=estebank
[rust.git] / src / tools / clippy / tests / ui / map_flatten.stderr
1 error: called `map(..).flatten()` on an `Iterator`
2   --> $DIR/map_flatten.rs:18:46
3    |
4 LL |     let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id).flatten().collect();
5    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id)`
6    |
7    = note: `-D clippy::map-flatten` implied by `-D warnings`
8
9 error: called `map(..).flatten()` on an `Iterator`
10   --> $DIR/map_flatten.rs:19:46
11    |
12 LL |     let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_ref).flatten().collect();
13    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id_ref)`
14
15 error: called `map(..).flatten()` on an `Iterator`
16   --> $DIR/map_flatten.rs:20:46
17    |
18 LL |     let _: Vec<_> = vec![5_i8; 6].into_iter().map(option_id_closure).flatten().collect();
19    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(option_id_closure)`
20
21 error: called `map(..).flatten()` on an `Iterator`
22   --> $DIR/map_flatten.rs:21:46
23    |
24 LL |     let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| x.checked_add(1)).flatten().collect();
25    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `filter_map` instead: `.filter_map(|x| x.checked_add(1))`
26
27 error: called `map(..).flatten()` on an `Iterator`
28   --> $DIR/map_flatten.rs:24:46
29    |
30 LL |     let _: Vec<_> = vec![5_i8; 6].into_iter().map(|x| 0..x).flatten().collect();
31    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^ help: try using `flat_map` instead: `.flat_map(|x| 0..x)`
32
33 error: called `map(..).flatten()` on an `Option`
34   --> $DIR/map_flatten.rs:27:39
35    |
36 LL |     let _: Option<_> = (Some(Some(1))).map(|x| x).flatten();
37    |                                       ^^^^^^^^^^^^^^^^^^^^^ help: try using `and_then` instead: `.and_then(|x| x)`
38
39 error: called `map(..).flatten()` on an `Result`
40   --> $DIR/map_flatten.rs:30:41
41    |
42 LL |     let _: Result<_, &str> = (Ok(Ok(1))).map(|x| x).flatten();
43    |                                         ^^^^^^^^^^^^^^^^^^^^^ help: try using `and_then` instead: `.and_then(|x| x)`
44
45 error: aborting due to 7 previous errors
46