mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
f2043989ca
Signed-off-by: TennyZhuang <zty0826@gmail.com>
18 lines
451 B
Rust
18 lines
451 B
Rust
// run-rustfix
|
|
#![warn(clippy::suboptimal_flops)]
|
|
#![allow(clippy::unnecessary_cast)]
|
|
|
|
fn main() {
|
|
let x = 3f32;
|
|
let y = 5f32;
|
|
let _ = x.log(y);
|
|
let _ = (x as f32).log(y);
|
|
let _ = x.log(y);
|
|
let _ = x.log(y);
|
|
let _ = x.log(y);
|
|
// Cases where the lint shouldn't be applied
|
|
let _ = x.ln() / y.powf(3.2);
|
|
let _ = x.powf(3.2) / y.powf(3.2);
|
|
let _ = x.powf(3.2) / y.ln();
|
|
let _ = x.log(5f32) / y.log(7f32);
|
|
}
|