From 45bb0f12944e0c73a6f8511e03d3a7ca53324bce Mon Sep 17 00:00:00 2001 From: Aziz Unsal Date: Mon, 21 Nov 2022 14:33:39 +0300 Subject: [PATCH] Solved clippy exercise1 by using pre-defined PI constant instead if manually defining it. --- exercises/clippy/clippy1.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/exercises/clippy/clippy1.rs b/exercises/clippy/clippy1.rs index bad46891fe..7b411faba0 100644 --- a/exercises/clippy/clippy1.rs +++ b/exercises/clippy/clippy1.rs @@ -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);