From d152ca04bdacf1f278ba81991b4845eda33de9fd Mon Sep 17 00:00:00 2001 From: Kit Freddura Date: Sun, 2 Oct 2016 13:44:23 -0700 Subject: [PATCH] updated zero_div_zero.rs --- clippy_lints/src/zero_div_zero.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/zero_div_zero.rs b/clippy_lints/src/zero_div_zero.rs index 71221933d56c..64ec3e5eec70 100644 --- a/clippy_lints/src/zero_div_zero.rs +++ b/clippy_lints/src/zero_div_zero.rs @@ -38,8 +38,8 @@ impl LateLintPass for Pass { // 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(left), let Some(Constant::Float(ref rhs_value, rhs_width)) = constant_simple(right), - let Some(0.0) = lhs_value.parse().ok(), - let Some(0.0) = rhs_value.parse().ok() + let Ok(0.0) = lhs_value.parse(), + let 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.