mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 05:52:23 -05:00
Fix clippy1
This commit is contained in:
parent
d3cdeed871
commit
0b220f9fff
1 changed files with 2 additions and 4 deletions
|
@ -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.
|
// TODO: Fix the Clippy lint in this line.
|
||||||
let pi = PI;
|
let pi = 3.14;
|
||||||
let radius: f32 = 5.0;
|
let radius: f32 = 5.0;
|
||||||
|
|
||||||
let area = pi * radius.powi(2);
|
let area = pi * radius.powi(2);
|
||||||
|
|
Loading…
Reference in a new issue