pub fn section<'lookup>(
        &mut self,
        section_name: &'lookup str,
        subsection_name: Option<&'lookup str>,
    ) -> Result<&SectionBody<'event>, GitConfigError<'lookup>> {
        let section_ids = self.get_section_ids_by_name_and_subname(section_name, subsection_name)?;
        let id = section_ids
            .last()
            .expect("Section lookup vec was empty, internal invariant violated");
        Ok(self
            .sections
            .get(id)
            .expect("Section did not have id from lookup, internal invariant violated"))
    }
/// Returns an immutable section reference.
///
/// # Errors
///
/// This function will return an error if the section and optional
/// subsection do not exist.
Returns an immutable section reference.
Returns an immutable section reference .
pub fn section<'lookup>(
        &mut self,
        section_name: &'lookup str,
        subsection_name: Option<&'lookup str>,
    ) -> Result<&SectionBody<'event>, GitConfigError<'lookup>> {
        let section_ids = self.get_section_ids_by_name_and_subname(section_name, subsection_name)?;
        let id = section_ids
            .last()
            .expect("Section lookup vec was empty, internal invariant violated");
        Ok(self
            .sections
            .get(id)
            .expect("Section did not have id from lookup, internal invariant violated"))
    }
pub fn section < ' lookup > ( & mut self , section_name : & ' lookup str , subsection_name : Option < & ' lookup str > , ) -> Result < & SectionBody < ' event > , GitConfigError < ' lookup > > { let section_ids = self . get_section_ids_by_name_and_subname ( section_name , subsection_name ) ? ; let id = section_ids . last ( ) . expect ( " " ) ; Ok ( self . sections . get ( id ) . expect ( " " ) ) }
Returns an immutable section reference.
Returns an immutable section reference .
&mut self
section_name
&'lookup str
subsection_name
Option<&'lookup str>
errors
This function will return an error if the section and optional
subsection do not exist.
This function will return an error if the section and optional subsection do not exist .