]> git.lizzy.rs Git - rust.git/commitdiff
Lint
authorJerry Hardee <hardeejj9@gmail.com>
Mon, 15 Jul 2019 19:00:07 +0000 (14:00 -0500)
committerJerry Hardee <hardeejj9@gmail.com>
Mon, 15 Jul 2019 19:00:07 +0000 (14:00 -0500)
clippy_lints/src/misc.rs

index 04c0983db68830358b0990fb8ff8299b50bae276..d89f886a39b3f07eb4f7831111316cf8004cb1cf 100644 (file)
@@ -511,13 +511,11 @@ fn is_signum(cx: &LateContext<'_, '_>, expr: &Expr) -> bool {
         if sym!(signum) == method_name.ident.name;
         // Check that the receiver of the signum() is a float (expressions[0] is the receiver of
         // the method call)
-        if is_float(cx, &expressions[0]);
         then {
-            true
-        } else {
-            false
+            return is_float(cx, &expressions[0]);
         }
     }
+    false
 }
 
 fn is_float(cx: &LateContext<'_, '_>, expr: &Expr) -> bool {