rustlings

solving rustlings ft. dracuxan
git clone [email protected]:dracuxan/rustlings.git
Log | Files | Refs

clippy1.rs (508B)


      1 // The Clippy tool is a collection of lints to analyze your code so you can
      2 // catch common mistakes and improve your Rust code.
      3 //
      4 // For these exercises, the code will fail to compile when there are Clippy
      5 // warnings. Check Clippy's suggestions from the output to solve the exercise.
      6 
      7 fn main() {
      8     // TODO: Fix the Clippy lint in this line.
      9     let pi = 3.14;
     10     let radius: f32 = 5.0;
     11 
     12     let area = pi * radius.powi(2);
     13 
     14     println!("The area of a circle with radius {radius:.2} is {area:.5}");
     15 }