pub fn resolve_name<'a>(
        &'a self,
        name_reference: &NameReference,
    ) -> std::result::Result<Cow<'a, str>, InvalidNameIndexError> {
        let index = name_reference.index as usize;
        if self.names.len() > index {
            let mut name = Cow::from(&self.names[index]);
            if let Some(number) = name_reference.number {
                name.to_mut().push_str(&format!("_{}", number.get() - 1));
            }
            Ok(name)
        } else {
            Err(InvalidNameIndexError(name_reference.index))
        }
    }
/// Look up the string representation for a given [`NameReference`].
Look up the string representation for a given [`NameReference`].
Look up the string representation for a given [ ` NameReference ` ] .
pub fn resolve_name<'a>(
        &'a self,
        name_reference: &NameReference,
    ) -> std::result::Result<Cow<'a, str>, InvalidNameIndexError> {
        let index = name_reference.index as usize;
        if self.names.len() > index {
            let mut name = Cow::from(&self.names[index]);
            if let Some(number) = name_reference.number {
                name.to_mut().push_str(&format!("_{}", number.get() - 1));
            }
            Ok(name)
        } else {
            Err(InvalidNameIndexError(name_reference.index))
        }
    }
pub fn resolve_name < ' a > ( & ' a self , name_reference : & NameReference , ) -> std :: result :: Result < Cow < ' a , str > , InvalidNameIndexError > { let index = name_reference . index as usize ; if self . names . len ( ) > index { let mut name = Cow :: from ( & self . names [ index ] ) ; if let Some ( number ) = name_reference . number { name . to_mut ( ) . push_str ( & format ! ( " " number get ( ) 1 ) ) ; } Ok ( name ) } else { Err ( InvalidNameIndexError ( name_reference . index ) ) } }
Look up the string representation for a given [`NameReference`].
Look up the string representation for a given [ ` NameReference ` ] .
&'a self
name_reference
&NameReference