From 2de9d544b1286497662b08204ac310a85e5aa949 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 18 Oct 2024 08:07:22 -0700 Subject: [PATCH] Delete unreachable branch from Number::from_128 --- src/number.rs | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/number.rs b/src/number.rs index 0f43b8595..c481b67d4 100644 --- a/src/number.rs +++ b/src/number.rs @@ -330,31 +330,17 @@ impl Number { } Err(_) => match i64::try_from(i) { Ok(i) => { - if i >= 0 { - let n = { - #[cfg(not(feature = "arbitrary_precision"))] - { - N::PosInt(i as u64) - } - #[cfg(feature = "arbitrary_precision")] - { - i.to_string() - } - }; - Some(Number { n }) - } else { - let n = { - #[cfg(not(feature = "arbitrary_precision"))] - { - N::NegInt(i) - } - #[cfg(feature = "arbitrary_precision")] - { - i.to_string() - } - }; - Some(Number { n }) - } + let n = { + #[cfg(not(feature = "arbitrary_precision"))] + { + N::NegInt(i) + } + #[cfg(feature = "arbitrary_precision")] + { + i.to_string() + } + }; + Some(Number { n }) } Err(_) => None, },