mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-02 00:39:20 +00:00
Un-solve clippy1.rs
This commit is contained in:
parent
30d5b7db92
commit
10399c2238
@ -4,11 +4,9 @@
|
|||||||
// For these exercises, the code will fail to compile when there are Clippy
|
// For these exercises, the code will fail to compile when there are Clippy
|
||||||
// warnings. Check Clippy's suggestions from the output to solve the exercise.
|
// warnings. Check Clippy's suggestions from the output to solve the exercise.
|
||||||
|
|
||||||
use std::f32::consts::PI;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Use the more accurate `PI` constant.
|
// Use the more accurate `PI` constant.
|
||||||
let pi = PI;
|
let pi = 3.141592;
|
||||||
let radius: f32 = 5.0;
|
let radius: f32 = 5.0;
|
||||||
|
|
||||||
let area = pi * radius.powi(2);
|
let area = pi * radius.powi(2);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user