rust/tests/ui/result_map_unit_fn.stderr

195 lines
7.5 KiB
Plaintext
Raw Normal View History

2018-04-15 11:00:12 +00:00
error: called `map(f)` on an Result value where `f` is a unit function
--> $DIR/result_map_unit_fn.rs:43:5
2018-04-15 11:00:12 +00:00
|
43 | x.field.map(do_nothing);
2018-04-15 11:00:12 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(x_field) = x.field { do_nothing(...) }`
|
= note: `-D clippy::result-map-unit-fn` implied by `-D warnings`
2018-04-15 11:00:12 +00:00
error: called `map(f)` on an Result value where `f` is a unit function
--> $DIR/result_map_unit_fn.rs:45:5
2018-04-15 11:00:12 +00:00
|
45 | x.field.map(do_nothing);
2018-04-15 11:00:12 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(x_field) = x.field { do_nothing(...) }`
error: called `map(f)` on an Result value where `f` is a unit function
--> $DIR/result_map_unit_fn.rs:47:5
2018-04-15 11:00:12 +00:00
|
47 | x.field.map(diverge);
2018-04-15 11:00:12 +00:00
| ^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(x_field) = x.field { diverge(...) }`
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:53:5
2018-04-15 11:00:12 +00:00
|
53 | x.field.map(|value| x.do_result_nothing(value + captured));
2018-04-15 11:00:12 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { x.do_result_nothing(value + captured) }`
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:55:5
2018-04-15 11:00:12 +00:00
|
55 | x.field.map(|value| { x.do_result_plus_one(value + captured); });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { x.do_result_plus_one(value + captured); }`
2018-04-15 11:00:12 +00:00
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:58:5
2018-04-15 11:00:12 +00:00
|
58 | x.field.map(|value| do_nothing(value + captured));
2018-04-15 11:00:12 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:60:5
2018-04-15 11:00:12 +00:00
|
60 | x.field.map(|value| { do_nothing(value + captured) });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
2018-04-15 11:00:12 +00:00
| |
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured) }`
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:62:5
2018-04-15 11:00:12 +00:00
|
62 | x.field.map(|value| { do_nothing(value + captured); });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
2018-04-15 11:00:12 +00:00
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:64:5
2018-04-15 11:00:12 +00:00
|
64 | x.field.map(|value| { { do_nothing(value + captured); } });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { do_nothing(value + captured); }`
2018-04-15 11:00:12 +00:00
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:67:5
2018-04-15 11:00:12 +00:00
|
67 | x.field.map(|value| diverge(value + captured));
2018-04-15 11:00:12 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:69:5
2018-04-15 11:00:12 +00:00
|
69 | x.field.map(|value| { diverge(value + captured) });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
2018-04-15 11:00:12 +00:00
| |
| help: try this: `if let Ok(value) = x.field { diverge(value + captured) }`
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:71:5
2018-04-15 11:00:12 +00:00
|
71 | x.field.map(|value| { diverge(value + captured); });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:73:5
|
73 | x.field.map(|value| { { diverge(value + captured); } });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { diverge(value + captured); }`
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:78:5
|
78 | x.field.map(|value| { let y = plus_one(value + captured); });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { let y = plus_one(value + captured); }`
2018-04-15 11:00:12 +00:00
error: called `map(f)` on an Result value where `f` is a unit closure
2018-10-06 16:18:06 +00:00
--> $DIR/result_map_unit_fn.rs:80:5
2018-04-15 11:00:12 +00:00
|
80 | x.field.map(|value| { plus_one(value + captured); });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
2018-04-15 11:00:12 +00:00
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:82:5
2018-04-15 11:00:12 +00:00
|
82 | x.field.map(|value| { { plus_one(value + captured); } });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { plus_one(value + captured); }`
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:85:5
|
85 | x.field.map(|ref value| { do_nothing(value + captured) });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(ref value) = x.field { do_nothing(value + captured) }`
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:88:5
|
88 | x.field.map(|value| { do_nothing(value); do_nothing(value) });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { ... }`
2018-04-15 11:00:12 +00:00
error: called `map(f)` on an Result value where `f` is a unit closure
2018-10-06 16:18:06 +00:00
--> $DIR/result_map_unit_fn.rs:90:5
2018-04-15 11:00:12 +00:00
|
90 | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(value) = x.field { ... }`
2018-04-15 11:00:12 +00:00
error: called `map(f)` on an Result value where `f` is a unit closure
2018-12-10 05:27:19 +00:00
--> $DIR/result_map_unit_fn.rs:94:5
2018-04-15 11:00:12 +00:00
|
2018-12-10 05:27:19 +00:00
94 | x.field.map(|value| {
2018-04-15 11:00:12 +00:00
| _____^
| |_____|
| ||
95 | || do_nothing(value);
96 | || do_nothing(value)
97 | || });
| ||______^- help: try this: `if let Ok(value) = x.field { ... }`
2018-04-15 11:00:12 +00:00
| |_______|
|
2018-12-10 05:27:19 +00:00
error: called `map(f)` on an Result value where `f` is a unit closure
--> $DIR/result_map_unit_fn.rs:98:5
|
98 | x.field.map(|value| { do_nothing(value); do_nothing(value); });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
2018-12-10 05:27:19 +00:00
| |
| help: try this: `if let Ok(value) = x.field { ... }`
2018-04-15 11:00:12 +00:00
error: called `map(f)` on an Result value where `f` is a unit function
--> $DIR/result_map_unit_fn.rs:102:5
2018-10-06 16:18:06 +00:00
|
102 | "12".parse::<i32>().map(diverge);
2018-10-06 16:18:06 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(_) = "12".parse::<i32>() { diverge(...) }`
2018-04-15 11:00:12 +00:00
error: called `map(f)` on an Result value where `f` is a unit function
--> $DIR/result_map_unit_fn.rs:108:5
|
108 | y.map(do_nothing);
| ^^^^^^^^^^^^^^^^^-
| |
| help: try this: `if let Ok(_y) = y { do_nothing(...) }`
2018-04-15 11:00:12 +00:00
error: aborting due to 23 previous errors