/// Return an error if two methods share a shorthand
Return an error if two methods share a shorthand
Return an error if two methods share a shorthand
pub(super) fn check_duplicate_shorthands(methods: &[super::Method]) -> super::Result<()> {
    for (i1, m1) in methods.iter().enumerate() {
        for m2 in &methods[..i1] {
            if m1.shorthand == m2.shorthand {
                return Err(Error::DuplicateShorthand {
                    shorthand: m1.shorthand.to_owned(),
                    title1: m1.title().to_owned(),
                    title2: m2.title().to_owned(),
                });
            }
        }
    }
    Ok(())
}
pub ( super ) fn check_duplicate_shorthands ( methods : & [ super :: Method ] ) -> super :: Result < ( ) > { for ( i1 , m1 ) in methods . iter ( ) . enumerate ( ) { for m2 in & methods [ .. i1 ] { if m1 . shorthand == m2 . shorthand { return Err ( Error :: DuplicateShorthand { shorthand : m1 . shorthand . to_owned ( ) , title1 : m1 . title ( ) . to_owned ( ) , title2 : m2 . title ( ) . to_owned ( ) , } ) ; } } } Ok ( ( ) ) }
Return an error if two methods share a shorthand
Return an error if two methods share a shorthand
methods
&[super::Method]