2020-02-14 14:25:03 +00:00
|
|
|
// clippy2.rs
|
2023-09-10 16:38:07 +00:00
|
|
|
//
|
2023-05-29 17:39:08 +00:00
|
|
|
// Execute `rustlings hint clippy2` or use the `hint` watch subcommand for a
|
|
|
|
// hint.
|
2020-02-14 14:25:03 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut res = 42;
|
|
|
|
let option = Some(12);
|
2023-09-10 16:38:07 +00:00
|
|
|
if let Some(x) = option {
|
2020-02-14 14:25:03 +00:00
|
|
|
res += x;
|
|
|
|
}
|
|
|
|
println!("{}", res);
|
|
|
|
}
|