]> git.lizzy.rs Git - rust.git/commitdiff
Fix a future compat lint that we triggered
authorOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Wed, 10 May 2017 07:21:21 +0000 (09:21 +0200)
committerOliver Schneider <git-spam-no-reply9815368754983@oli-obk.de>
Wed, 10 May 2017 07:21:21 +0000 (09:21 +0200)
clippy_lints/src/zero_div_zero.rs

index eb298f9bc7b3211d221b72420ec4c2a258ffa97d..b00d23d6fba008c1482c116545579eb4e7bfd85f 100644 (file)
@@ -38,8 +38,8 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
             // do something like 0.0/(2.0 - 2.0), but it would be nice to warn on that case too.
             let Some(Constant::Float(ref lhs_value, lhs_width)) = constant_simple(cx, left),
             let Some(Constant::Float(ref rhs_value, rhs_width)) = constant_simple(cx, right),
-            let Ok(0.0) = lhs_value.parse(),
-            let Ok(0.0) = rhs_value.parse()
+            Ok(0.0) == lhs_value.parse(),
+            Ok(0.0) == rhs_value.parse()
         ], {
             // since we're about to suggest a use of std::f32::NaN or std::f64::NaN,
             // match the precision of the literals that are given.