summaryrefslogtreecommitdiff
path: root/solutions
diff options
context:
space:
mode:
Diffstat (limited to 'solutions')
-rw-r--r--solutions/22_clippy/clippy2.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/solutions/22_clippy/clippy2.rs b/solutions/22_clippy/clippy2.rs
index 4e18198..7f63562 100644
--- a/solutions/22_clippy/clippy2.rs
+++ b/solutions/22_clippy/clippy2.rs
@@ -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}");
+}