mirror of
https://github.com/ArthurDanjou/rustlings.git
synced 2026-02-05 06:07:50 +01:00
Add initial solution files for Rustlings exercises and quizzes
- Created empty solution files for various exercises in strings, modules, hashmaps, options, error handling, generics, traits, lifetimes, tests, iterators, smart pointers, threads, macros, clippy, conversions, and quizzes. - Each solution file contains a main function with a comment indicating that it will be automatically filled after completing the exercise. - Added a README.md file to provide information about the solutions and their purpose.
This commit is contained in:
10
exercises/22_clippy/clippy2.rs
Normal file
10
exercises/22_clippy/clippy2.rs
Normal file
@@ -0,0 +1,10 @@
|
||||
fn main() {
|
||||
let mut res = 42;
|
||||
let option = Some(12);
|
||||
// TODO: Fix the Clippy lint.
|
||||
if let Some(x) = option {
|
||||
res += x;
|
||||
}
|
||||
|
||||
println!("{res}");
|
||||
}
|
||||
Reference in New Issue
Block a user