mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-14 09:21:01 +00:00
i64::wrapping_neg is not stable yet
This commit is contained in:
@@ -259,7 +259,9 @@ impl<Iter> Deserializer<Iter>
|
|||||||
if pos {
|
if pos {
|
||||||
visitor.visit_u64(res)
|
visitor.visit_u64(res)
|
||||||
} else {
|
} else {
|
||||||
let res_i64 = (res as i64).wrapping_neg();
|
// FIXME: `wrapping_neg` will be stable in Rust 1.2
|
||||||
|
//let res_i64 = (res as i64).wrapping_neg();
|
||||||
|
let res_i64 = (!res + 1) as i64;
|
||||||
|
|
||||||
// Convert into a float if we underflow.
|
// Convert into a float if we underflow.
|
||||||
if res_i64 > 0 {
|
if res_i64 > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user