Update float_cmp message

This commit is contained in:
Vincent Prouillet 2016-03-24 17:07:55 +00:00
parent 68b2f12adf
commit 341b7d3f6b

View File

@ -167,8 +167,9 @@ fn check_expr(&mut self, cx: &LateContext, expr: &Expr) {
span_lint(cx,
FLOAT_CMP,
expr.span,
&format!("{}-comparison of f32 or f64 detected. Consider changing this to `abs({} - {}) < \
epsilon` for some suitable value of epsilon",
&format!("{}-comparison of f32 or f64 detected. Consider changing this to `({} - {}).abs() < \
epsilon` for some suitable value of epsilon. \
std::f32::EPSILON and std::f64::EPSILON are available.",
binop_to_string(op),
snippet(cx, left.span, ".."),
snippet(cx, right.span, "..")));