For BitFlags<T, N> converting to N with bits() is infallible. Thus, it need not be a try_from() and instead just from() where the impl is just bits(). A user can't do this themselves because of the orphan rule unless they make a newtype.
i.e. when N == u8:
impl<T> From<BitFlags<T, u8>> for u8 {
fn from(value: BitFlags<T, u8>) -> Self {
value.bits()
}
}
For
BitFlags<T, N>converting toNwithbits()is infallible. Thus, it need not be atry_from()and instead justfrom()where the impl is justbits(). A user can't do this themselves because of the orphan rule unless they make a newtype.i.e. when
N == u8: