2018-04-09 06:20:46 +00:00
|
|
|
error: called `map(f)` on an Option value where `f` is a unit function
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:34:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
34 | x.field.map(do_nothing);
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
2018-04-15 09:37:35 +00:00
|
|
|
| help: try this: `if let Some(x_field) = x.field { do_nothing(...) }`
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
= note: `-D clippy::option-map-unit-fn` implied by `-D warnings`
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit function
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:36:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
36 | x.field.map(do_nothing);
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
2018-04-15 09:37:35 +00:00
|
|
|
| help: try this: `if let Some(x_field) = x.field { do_nothing(...) }`
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit function
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:38:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
38 | x.field.map(diverge);
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
2018-04-15 09:37:35 +00:00
|
|
|
| help: try this: `if let Some(x_field) = x.field { diverge(...) }`
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:44:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
44 | x.field.map(|value| x.do_option_nothing(value + captured));
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(value) = x.field { x.do_option_nothing(value + captured) }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:46:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
46 | x.field.map(|value| { x.do_option_plus_one(value + captured); });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(value) = x.field { x.do_option_plus_one(value + captured); }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:49:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
49 | x.field.map(|value| do_nothing(value + captured));
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(value) = x.field { do_nothing(value + captured) }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:51:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
51 | x.field.map(|value| { do_nothing(value + captured) });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(value) = x.field { do_nothing(value + captured) }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:53:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
53 | x.field.map(|value| { do_nothing(value + captured); });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
2018-04-10 20:13:58 +00:00
|
|
|
| help: try this: `if let Some(value) = x.field { do_nothing(value + captured); }`
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:55:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
55 | x.field.map(|value| { { do_nothing(value + captured); } });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
2018-04-10 20:13:58 +00:00
|
|
|
| help: try this: `if let Some(value) = x.field { do_nothing(value + captured); }`
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:58:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
58 | x.field.map(|value| diverge(value + captured));
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(value) = x.field { diverge(value + captured) }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:60:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
60 | x.field.map(|value| { diverge(value + captured) });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(value) = x.field { diverge(value + captured) }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:62:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
62 | x.field.map(|value| { diverge(value + captured); });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
2018-04-10 20:13:58 +00:00
|
|
|
| help: try this: `if let Some(value) = x.field { diverge(value + captured); }`
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:64:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
64 | x.field.map(|value| { { diverge(value + captured); } });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
2018-04-10 20:13:58 +00:00
|
|
|
| help: try this: `if let Some(value) = x.field { diverge(value + captured); }`
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:69:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
69 | x.field.map(|value| { let y = plus_one(value + captured); });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(value) = x.field { let y = plus_one(value + captured); }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:71:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
71 | x.field.map(|value| { plus_one(value + captured); });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(value) = x.field { plus_one(value + captured); }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:73:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
73 | x.field.map(|value| { { plus_one(value + captured); } });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(value) = x.field { plus_one(value + captured); }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:76:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
76 | x.field.map(|ref value| { do_nothing(value + captured) });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(ref value) = x.field { do_nothing(value + captured) }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:79:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
79 | x.field.map(|value| { do_nothing(value); do_nothing(value) });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(value) = x.field { ... }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:81:5
|
2018-04-09 06:20:46 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
81 | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) });
|
2018-04-09 06:20:46 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(value) = x.field { ... }`
|
|
|
|
|
2018-04-15 09:35:20 +00:00
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:85:5
|
2018-04-15 09:35:20 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
85 | x.field.map(|value| {
|
2018-04-15 09:35:20 +00:00
|
|
|
| _____^
|
|
|
|
| |_____|
|
|
|
|
| ||
|
2018-08-01 14:30:44 +00:00
|
|
|
86 | || do_nothing(value);
|
|
|
|
87 | || do_nothing(value)
|
|
|
|
88 | || });
|
2018-04-15 09:35:20 +00:00
|
|
|
| ||______^- help: try this: `if let Some(value) = x.field { ... }`
|
|
|
|
| |_______|
|
2018-04-15 09:37:35 +00:00
|
|
|
|
|
2018-04-15 09:35:20 +00:00
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit closure
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:89:5
|
2018-04-15 09:35:20 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
89 | x.field.map(|value| { do_nothing(value); do_nothing(value); });
|
2018-04-15 09:35:20 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(value) = x.field { ... }`
|
|
|
|
|
2018-04-15 09:37:35 +00:00
|
|
|
error: called `map(f)` on an Option value where `f` is a unit function
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:92:5
|
2018-04-15 09:37:35 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
92 | Some(42).map(diverge);
|
2018-04-15 09:37:35 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(_) = Some(42) { diverge(...) }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit function
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:93:5
|
2018-04-15 09:37:35 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
93 | "12".parse::<i32>().ok().map(diverge);
|
2018-04-15 09:37:35 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(_) = "12".parse::<i32>().ok() { diverge(...) }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit function
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:94:5
|
2018-04-15 09:37:35 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
94 | Some(plus_one(1)).map(do_nothing);
|
2018-04-15 09:37:35 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(_) = Some(plus_one(1)) { do_nothing(...) }`
|
|
|
|
|
|
|
|
error: called `map(f)` on an Option value where `f` is a unit function
|
2018-08-01 14:30:44 +00:00
|
|
|
--> $DIR/option_map_unit_fn.rs:98:5
|
2018-04-15 09:37:35 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
98 | y.map(do_nothing);
|
2018-04-15 09:37:35 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^-
|
|
|
|
| |
|
|
|
|
| help: try this: `if let Some(_y) = y { do_nothing(...) }`
|
|
|
|
|
|
|
|
error: aborting due to 25 previous errors
|
2018-04-09 06:20:46 +00:00
|
|
|
|