rust-clippy/tests/ui/mul_add_fixable.rs
Ethan Lam 327c91f8c7 Addresses Issue #4001
Fixed typo

Fixes lint name and uses appropriate linting suggestion

changed lint help message

Added autofixable test

Added Autofixable Test

Removed Broken Autofixable File

updated lints

Generated Autofixable/Nonfixable Test Cases

Changed Suggestion Applicability

Updated Lint Count
2019-10-08 08:46:29 -05:00

24 lines
489 B
Rust

// run-rustfix
#![warn(clippy::manual_mul_add)]
#![allow(unused_variables)]
fn mul_add_test() {
let a: f64 = 1234.567;
let b: f64 = 45.67834;
let c: f64 = 0.0004;
// Auto-fixable examples
let test1 = a * b + c;
let test2 = c + a * b;
let test3 = (a * b) + c;
let test4 = c + (a * b);
let test5 = a.mul_add(b, c) * a.mul_add(b, c) + a.mul_add(b, c) + c;
let test6 = 1234.567_f64 * 45.67834_f64 + 0.0004_f64;
}
fn main() {
mul_add_test();
}