MCPcopy Index your code
hub / github.com/SoftbearStudios/bitcode / populate

Method populate

src/ext/arrayvec.rs:67–74  ·  view source on GitHub ↗
(&mut self, input: &mut &'a [u8], length: usize)

Source from the content-addressed store, hash-verified

65pub struct ArrayStringDecoder<'a, const N: usize>(StrDecoder<'a>);
66impl<'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}
76impl<'a, const N: usize> Decoder<'a, ArrayString<N>> for ArrayStringDecoder<'a, N> {
77 #[inline(always)]

Callers

nothing calls this directly

Calls 1

errFunction · 0.50

Tested by

no test coverage detected