uint
uint copied to clipboard
`support/scale`: Use nightly generic const expressions to validate that BITS parameter
On 2022-10-24 @recmo wrote in 04d968b
“Merge pull request #171 from shekhirin/parity-scale-codec”:
Use nightly generic const expressions to validate that BITS parameter is less than 536
Self::try_from_le_slice(&b).ok_or(Error::from("value is larger than fits the Uint"))
})
}
}
// TODO: Use nightly generic const expressions to validate that BITS parameter
// is less than 536
pub struct CompactUint<const BITS: usize, const LIMBS: usize>(pub Uint<BITS, LIMBS>);
impl<const BITS: usize, const LIMBS: usize> From<Uint<BITS, LIMBS>> for CompactUint<BITS, LIMBS> {
fn from(v: Uint<BITS, LIMBS>) -> Self {
Self(v)