1
Fork 0

Merge commit '9e3cd88718' into clippyup

This commit is contained in:
flip1995 2021-05-20 12:30:31 +02:00
parent 4f3b49fffa
commit 97705b7ea6
80 changed files with 2351 additions and 690 deletions

View file

@ -323,7 +323,7 @@ fn check_powi(cx: &LateContext<'_>, expr: &Expr<'_>, args: &[Expr<'_>]) {
cx,
SUBOPTIMAL_FLOPS,
parent.span,
"square can be computed more efficiently",
"multiply and add expressions can be calculated more efficiently and accurately",
"consider using",
format!(
"{}.mul_add({}, {})",
@ -337,16 +337,6 @@ fn check_powi(cx: &LateContext<'_>, expr: &Expr<'_>, args: &[Expr<'_>]) {
return;
}
}
span_lint_and_sugg(
cx,
SUBOPTIMAL_FLOPS,
expr.span,
"square can be computed more efficiently",
"consider using",
format!("{} * {}", Sugg::hir(cx, &args[0], ".."), Sugg::hir(cx, &args[0], "..")),
Applicability::MachineApplicable,
);
}
}
}