2 Lints usage of `if let Some(v) = ... { y } else { x }` and
3 `match .. { Some(v) => y, None/_ => x }` which are more
4 idiomatically done with `Option::map_or` (if the else bit is a pure
5 expression) or `Option::map_or_else` (if the else bit is an impure
9 Using the dedicated functions of the `Option` type is clearer and
10 more concise than an `if let` expression.
13 This lint uses a deliberately conservative metric for checking
14 if the inside of either body contains breaks or continues which will
15 cause it to not suggest a fix if either block contains a loop with
16 continues or breaks contained within the loop.
20 let _ = if let Some(foo) = optional {
25 let _ = match optional {
29 let _ = if let Some(foo) = optional {
32 let y = do_complicated_function();
40 let _ = optional.map_or(5, |foo| foo);
41 let _ = optional.map_or(5, |val| val + 1);
42 let _ = optional.map_or_else(||{
43 let y = do_complicated_function();