]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/result_map_unit_fn_unfixable.stderr
New upstream version 1.52.1+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / result_map_unit_fn_unfixable.stderr
CommitLineData
f20569fa
XL
1error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
2 --> $DIR/result_map_unit_fn_unfixable.rs:23:5
3 |
4LL | x.field.map(|value| { do_nothing(value); do_nothing(value) });
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
6 | |
7 | help: try this: `if let Ok(value) = x.field { ... }`
8 |
9 = note: `-D clippy::result-map-unit-fn` implied by `-D warnings`
10
11error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
12 --> $DIR/result_map_unit_fn_unfixable.rs:25:5
13 |
14LL | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
15 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
16 | |
17 | help: try this: `if let Ok(value) = x.field { ... }`
18
19error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
20 --> $DIR/result_map_unit_fn_unfixable.rs:29:5
21 |
22LL | x.field.map(|value| {
23 | _____^
24 | |_____|
25 | ||
26LL | || do_nothing(value);
27LL | || do_nothing(value)
28LL | || });
29 | ||______^- help: try this: `if let Ok(value) = x.field { ... }`
30 | |_______|
31 |
32
33error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
34 --> $DIR/result_map_unit_fn_unfixable.rs:33:5
35 |
36LL | x.field.map(|value| { do_nothing(value); do_nothing(value); });
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
38 | |
39 | help: try this: `if let Ok(value) = x.field { ... }`
40
41error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
42 --> $DIR/result_map_unit_fn_unfixable.rs:37:5
43 |
44LL | "12".parse::<i32>().map(diverge);
45 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
46 | |
47 | help: try this: `if let Ok(a) = "12".parse::<i32>() { diverge(a) }`
48
49error: called `map(f)` on an `Result` value where `f` is a function that returns the unit type `()`
50 --> $DIR/result_map_unit_fn_unfixable.rs:43:5
51 |
52LL | y.map(do_nothing);
53 | ^^^^^^^^^^^^^^^^^-
54 | |
55 | help: try this: `if let Ok(_y) = y { do_nothing(_y) }`
56
57error: aborting due to 6 previous errors
58