]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/literal_representation.rs
Do not lint float fractions in `mistyped_literal_suffixes` (fixes #4706)
[rust.git] / clippy_lints / src / literal_representation.rs
index a36fdca5d5de6a5816d8ff369501fad9c651b3dd..c54103b25c20e772f401a1cdcb6bc587d6d61fbe 100644 (file)
@@ -264,13 +264,10 @@ fn check_for_mistyped_suffix(
 
         let (part, mistyped_suffixes, missing_char) = if let Some((_, exponent)) = &mut num_lit.exponent {
             (exponent, &["32", "64"][..], 'f')
+        } else if num_lit.fraction.is_some() {
+            (&mut num_lit.integer, &["32", "64"][..], 'f')
         } else {
-            num_lit
-                .fraction
-                .as_mut()
-                .map_or((&mut num_lit.integer, &["8", "16", "32", "64"][..], 'i'), |fraction| {
-                    (fraction, &["32", "64"][..], 'f')
-                })
+            (&mut num_lit.integer, &["8", "16", "32", "64"][..], 'i')
         };
 
         let mut split = part.rsplit('_');