pub fn parse_locals(input: &[u8]) -> IResult<&[u8], ResultType> {
    let (input, length) = parse_u32(input)?;
    let length = length as usize;
    let (remaining, value_types) = fold_many_m_n(
        length,
        length,
        tuple((parse_u32, parse_value_type)),
        Vec::new,
        |mut accumulator, (count, kind)| {
            accumulator.reserve(count as usize);
            accumulator.extend((0..count).map(|_| kind));
            accumulator
        },
    )(input)?;

    Ok((remaining, value_types.into()))
}
/// Parses the value types of locals in a function.
///
/// See <https://webassembly.github.io/spec/core/binary/modules.html#code-section>
Parses the value types of locals in a function.
See
Parses the value types of locals in a function . See
pub fn parse_locals(input: &[u8]) -> IResult<&[u8], ResultType> {
    let (input, length) = parse_u32(input)?;
    let length = length as usize;
    let (remaining, value_types) = fold_many_m_n(
        length,
        length,
        tuple((parse_u32, parse_value_type)),
        Vec::new,
        |mut accumulator, (count, kind)| {
            accumulator.reserve(count as usize);
            accumulator.extend((0..count).map(|_| kind));
            accumulator
        },
    )(input)?;
    Ok((remaining, value_types.into()))
}
pub fn parse_locals ( input : & [ u8 ] ) -> IResult < & [ u8 ] , ResultType > { let ( input , length ) = parse_u32 ( input ) ? ; let length = length as usize ; let ( remaining , value_types ) = fold_many_m_n ( length , length , tuple ( ( parse_u32 , parse_value_type ) ) , Vec :: new , | mut accumulator , ( count , kind ) | { accumulator . reserve ( count as usize ) ; accumulator . extend ( ( 0 .. count ) . map ( | _ | kind ) ) ; accumulator } , ) ( input ) ? ; Ok ( ( remaining , value_types . into ( ) ) ) }
Parses the value types of locals in a function.
Parses the value types of locals in a function .
input
&[u8]
input
&[u8]