~jplatte/js_int

0038702eebd7dc8d37d6050eac32fbf802f4d8f3 — Jonas Platte 3 months ago c45b3d5
Add From<UInt> for Int
1 files changed, 7 insertions(+), 1 deletions(-)

M src/int.rs
M src/int.rs => src/int.rs +7 -1
@@ 13,7 13,7 @@ use serde::{

use crate::{
    error::{ParseIntError, ParseIntErrorKind, TryFromIntError},
    MAX_SAFE_UINT,
    UInt, MAX_SAFE_UINT,
};

/// The largest integer value that can be represented exactly by an f64.


@@ 429,6 429,12 @@ impl From<u32> for Int {
    }
}

impl From<UInt> for Int {
    fn from(val: UInt) -> Self {
        Self(i64::from(val))
    }
}

impl TryFrom<u64> for Int {
    type Error = TryFromIntError;