]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/approx_const.rs
Add lint for redundant pattern matching in iflet for Result/Option
[rust.git] / clippy_lints / src / approx_const.rs
index 01877465c00a06631a67762934768ef86d18ac93..34d31344cddb37088c91cc6e7525805a7cab4429 100644 (file)
@@ -76,7 +76,7 @@ fn check_lit(cx: &LateContext, lit: &Lit, e: &Expr) {
 }
 
 fn check_known_consts(cx: &LateContext, e: &Expr, s: &str, module: &str) {
-    if let Ok(_) = s.parse::<f64>() {
+    if s.parse::<f64>().is_ok() {
         for &(constant, name, min_digits) in KNOWN_CONSTS {
             if is_approx_const(constant, s, min_digits) {
                 span_lint(cx,