Open Andrepuel opened 1 year ago
I think it is easier to explain using code:
impl<A: Array> ArrayVec<A> { #[inline] #[must_use] pub const fn from_array_len_capped(data: A, len: u16) -> Self{ let len = if len as usize <= A::CAPACITY { len } else { A::CAPACITY as u16 }; Self { data, len: len as u16 } } }
I think it is easier to explain using code: