recmo/uint

`bytes`: Use a `const {}` block for this assertion

Opened this issue · 0 comments

On 2023-07-29 @prestwich wrote in aaa37d2 “Merge pull request #277 from DaniPopes/no_alloc”:

Use a const {} block for this assertion

    /// Panics if the value is too large for the bit-size of the Uint.
    #[must_use]
    #[track_caller]
    #[inline]
    pub fn from_le_bytes<const BYTES: usize>(bytes: [u8; BYTES]) -> Self {
        // TODO: Use a `const {}` block for this assertion
        assert_eq!(BYTES, Self::BYTES, "BYTES must be equal to Self::BYTES");

        Self::try_from_le_slice(&bytes).expect("Value too large for Uint")
    }
}

From src/bytes.rs:271