mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-08-10 22:42:13 +02:00
fix(clippy1): Updated code to test correctness clippy lint with approx_constant lint rule
closes #888
This commit is contained in:
@@ -8,10 +8,16 @@
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
use std::f32;
|
||||
|
||||
fn main() {
|
||||
let x = 1.2331f64;
|
||||
let y = 1.2332f64;
|
||||
if y != x {
|
||||
println!("Success!");
|
||||
}
|
||||
let pi = 3.14f32;
|
||||
let radius = 5.00f32;
|
||||
|
||||
let area = pi * f32::powi(radius, 2);
|
||||
|
||||
println!(
|
||||
"The area of a circle with radius {:.2} is {:.5}!",
|
||||
radius, area
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user