~jplatte/js_int

c45b3d5e4ad2818a25f3c342b0cbc6de8416849f — Jonas Platte 3 months ago 56ce108
Add From<UInt> for i64, i128
1 files changed, 12 insertions(+), 0 deletions(-)

M src/uint.rs
M src/uint.rs => src/uint.rs +12 -0
@@ 471,6 471,18 @@ impl TryFrom<i128> for UInt {
    }
}

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

impl From<UInt> for i128 {
    fn from(val: UInt) -> Self {
        val.0 as i128
    }
}

macro_rules! uint_op_impl {
    ($trait:ident, $method:ident, $assign_trait:ident, $assign_method:ident) => {
        impl $trait for UInt {