diff options
| author | mo8it <mo8it@proton.me> | 2024-07-01 11:55:18 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-07-01 11:55:18 +0200 |
| commit | a0e810b4713bcef60f64f4709ee27c3acec676cd (patch) | |
| tree | a6659224d66a5950c39dd123e6891dc4905c607b /solutions/22_clippy/clippy2.rs | |
| parent | 78728d52387730300475cbe8c83497f603a14faf (diff) | |
clippy2 solution
Diffstat (limited to 'solutions/22_clippy/clippy2.rs')
| -rw-r--r-- | solutions/22_clippy/clippy2.rs | 11 |
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}"); +} |
