]> git.proxmox.com Git - rustc.git/blobdiff - library/core/src/num/dec2flt/mod.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / library / core / src / num / dec2flt / mod.rs
index c78492f5ae2c9ae0702f5ac06ac3c7de0647456b..2b280773e4c50a2f64abbf7fa8a0386d067b2d7c 100644 (file)
@@ -236,13 +236,8 @@ pub fn dec2flt<F: RawFloat>(s: &str) -> Result<F, ParseFloatError> {
 
     let num = match parse_number(s, negative) {
         Some(r) => r,
-        None => {
-            if let Some(value) = parse_inf_nan(s, negative) {
-                return Ok(value);
-            } else {
-                return Err(pfe_invalid());
-            }
-        }
+        None if let Some(value) = parse_inf_nan(s, negative) => return Ok(value),
+        None => return Err(pfe_invalid()),
     };
     if let Some(value) = num.try_fast_path::<F>() {
         return Ok(value);