finish clippy exercises

This commit is contained in:
lukaszKielar 2020-06-25 22:11:43 +02:00
parent 6d2dc6d7f6
commit a2278865f8
2 changed files with 3 additions and 7 deletions
exercises/clippy

View file

@ -6,12 +6,10 @@
// check clippy's suggestions from the output to solve the exercise.
// Execute `rustlings hint clippy1` for hints :)
// I AM NOT DONE
fn main() {
let x = 1.2331f64;
let y = 1.2332f64;
if y != x {
if (y - x).abs() > 1e-4 {
println!("Success!");
}
}

View file

@ -1,13 +1,11 @@
// clippy2.rs
// Make me compile! Execute `rustlings hint clippy2` for hints :)
// I AM NOT DONE
fn main() {
let mut res = 42;
let option = Some(12);
for x in option {
res += x;
if let Some(x) = option {
res += x
}
println!("{}", res);
}