mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-11-29 22:47:43 +02:00
clippy2 solution
This commit is contained in:
@@ -1 +1,10 @@
|
||||
// Solutions will be available before the stable release. Thank you for testing the beta version 🥰
|
||||
fn main() {
|
||||
let mut res = 42;
|
||||
let option = Some(12);
|
||||
// Use `if-let` instead of iteration.
|
||||
if let Some(x) = option {
|
||||
res += x;
|
||||
}
|
||||
|
||||
println!("{res}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user