parity-common
parity-common copied to clipboard
[uint] Implement From trait for conversions that can't fail
It would be nice to have the From trait implemented for conversions that can't fail, such as U64 -> u64.
// Today
let a: u64 = U64::MAX.try_into().unwrap();
let b: u128 = U128::MAX.try_into().unwrap();
// Requested
let x: u64 = U64::MAX.into();
let y: u128 = U128::MAX.into();
let z: u128 = U64::MAX.into();