| 65 | pub struct ArrayStringDecoder<'a, const N: usize>(StrDecoder<'a>); |
| 66 | impl<'a, const N: usize> View<'a> for ArrayStringDecoder<'a, N> { |
| 67 | fn populate(&mut self, input: &mut &'a [u8], length: usize) -> Result<()> { |
| 68 | self.0.populate(input, length)?; |
| 69 | // Safety: `length` was same length passed to populate. |
| 70 | if unsafe { self.0.lengths.any_greater_than::<N>(length) } { |
| 71 | return err("invalid ArrayString"); |
| 72 | } |
| 73 | Ok(()) |
| 74 | } |
| 75 | } |
| 76 | impl<'a, const N: usize> Decoder<'a, ArrayString<N>> for ArrayStringDecoder<'a, N> { |
| 77 | #[inline(always)] |