parity-common
parity-common copied to clipboard
U types do not convert to each other
Hello,
Is there a reason why U*
types do not implement From
/Into
from each other? At least to be able to cast upwards.
Example,
impl From<U64> for U128 {
fn from(num: U64) -> Self {
num.low_u64().into() // U128 implements From<u64>
}
}
impl From<U64> for U256 {
fn from(num: U64) -> Self {
num.low_u64().into() // U256 implements From<u64>
}
}
they do in primitive-types https://github.com/paritytech/parity-common/blob/2d571df7fee92b85b47b49cf14aa3a7641f2f3b9/primitive-types/src/lib.rs#L146-L252
anything missing?
U64
is kind of legacy, see https://github.com/paritytech/parity-common/pull/473
but we can probably add conversions from it in ethereum-types