mirror of
https://github.com/serde-rs/json.git
synced 2025-10-02 23:35:59 +00:00
Merge pull request #1200 from dtolnay/from128
Delete unreachable branch from Number::from_i128
This commit is contained in:
commit
22973d2783
@ -330,31 +330,17 @@ impl Number {
|
|||||||
}
|
}
|
||||||
Err(_) => match i64::try_from(i) {
|
Err(_) => match i64::try_from(i) {
|
||||||
Ok(i) => {
|
Ok(i) => {
|
||||||
if i >= 0 {
|
let n = {
|
||||||
let n = {
|
#[cfg(not(feature = "arbitrary_precision"))]
|
||||||
#[cfg(not(feature = "arbitrary_precision"))]
|
{
|
||||||
{
|
N::NegInt(i)
|
||||||
N::PosInt(i as u64)
|
}
|
||||||
}
|
#[cfg(feature = "arbitrary_precision")]
|
||||||
#[cfg(feature = "arbitrary_precision")]
|
{
|
||||||
{
|
i.to_string()
|
||||||
i.to_string()
|
}
|
||||||
}
|
};
|
||||||
};
|
Some(Number { n })
|
||||||
Some(Number { n })
|
|
||||||
} else {
|
|
||||||
let n = {
|
|
||||||
#[cfg(not(feature = "arbitrary_precision"))]
|
|
||||||
{
|
|
||||||
N::NegInt(i)
|
|
||||||
}
|
|
||||||
#[cfg(feature = "arbitrary_precision")]
|
|
||||||
{
|
|
||||||
i.to_string()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Some(Number { n })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Err(_) => None,
|
Err(_) => None,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user