uint icon indicating copy to clipboard operation
uint copied to clipboard

`support/scale`: Use nightly generic const expressions to validate that BITS parameter

Open github-actions[bot] opened this issue 2 years ago • 0 comments

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)

From src/support/scale.rs:41

github-actions[bot] avatar Oct 24 '22 07:10 github-actions[bot]