Skip to content

Commit

Permalink
Delete unreachable branch from Number::from_128
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Oct 18, 2024
1 parent 5fab5fc commit 2de9d54
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions src/number.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit 2de9d54

Please sign in to comment.