Add the obvious conversion from u64 to signed values.

This commit is contained in:
2018-12-30 17:09:48 -08:00
parent ae8266885b
commit 14fd156d3c

View File

@@ -12,6 +12,12 @@ macro_rules! generate_base_conversions
$sname{ negative: x < 0, value: $name::from(x.abs() as u128) } $sname{ negative: x < 0, value: $name::from(x.abs() as u128) }
} }
} }
impl From<u64> for $sname {
fn from(x: u64) -> $sname {
$sname{ negative: false, value: $name::from(x) }
}
}
}; };
} }