fn parse_type_path(decoder: &mut Decoder) -> Result<Vec<TypePathElement>> {
    let length = decoder.read_u8()?;
    let mut type_path = Vec::with_capacity(length as usize);

    for _ in 0..length {
        let path_kind = match decoder.read_u8()? {
            0x00 => TypePathKind::ArrayType,
            0x01 => TypePathKind::NestedType,
            0x02 => TypePathKind::WildcardType,
            0x03 => TypePathKind::Type,

            _ => return Err(Error::InvalidTypePath),
        };

        let argument_index = decoder.read_u8()?;
        type_path.push(TypePathElement {
            path_kind,
            argument_index,
        })
    }

    Ok(type_path)
}
/// Parses the type path of a type annotation
Parses the type path of a type annotation
Parses the type path of a type annotation
fn parse_type_path(decoder: &mut Decoder) -> Result<Vec<TypePathElement>> {
    let length = decoder.read_u8()?;
    let mut type_path = Vec::with_capacity(length as usize);
    for _ in 0..length {
        let path_kind = match decoder.read_u8()? {
            0x00 => TypePathKind::ArrayType,
            0x01 => TypePathKind::NestedType,
            0x02 => TypePathKind::WildcardType,
            0x03 => TypePathKind::Type,
            _ => return Err(Error::InvalidTypePath),
        };
        let argument_index = decoder.read_u8()?;
        type_path.push(TypePathElement {
            path_kind,
            argument_index,
        })
    }
    Ok(type_path)
}
fn parse_type_path ( decoder : & mut Decoder ) -> Result < Vec < TypePathElement > > { let length = decoder . read_u8 ( ) ? ; let mut type_path = Vec :: with_capacity ( length as usize ) ; for _ in 0 .. length { let path_kind = match decoder . read_u8 ( ) ? { 0x00 => TypePathKind :: ArrayType , 0x01 => TypePathKind :: NestedType , 0x02 => TypePathKind :: WildcardType , 0x03 => TypePathKind :: Type , _ => return Err ( Error :: InvalidTypePath ) , } ; let argument_index = decoder . read_u8 ( ) ? ; type_path . push ( TypePathElement { path_kind , argument_index , } ) } Ok ( type_path ) }
Parses the type path of a type annotation
Parses the type path of a type annotation
decoder
&mut Decoder