Skip to content

Commit

Permalink
Solved clippy exercise1 by using pre-defined PI constant instead if m…
Browse files Browse the repository at this point in the history
…anually defining it.
  • Loading branch information
Aziz Unsal authored and Aziz Unsal committed Nov 21, 2022
1 parent 4db6f88 commit 45bb0f1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions exercises/clippy/clippy1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
// check clippy's suggestions from the output to solve the exercise.
// Execute `rustlings hint clippy1` or use the `hint` watch subcommand for a hint.

// I AM NOT DONE

use std::f32;

fn main() {
let pi = 3.14f32;
let pi = f32::consts::PI;
let radius = 5.00f32;

let area = pi * f32::powi(radius, 2);
Expand Down

0 comments on commit 45bb0f1

Please sign in to comment.