pub fn matches(&self, other: &LanguageTag) -> bool {
        fn matches_option(a: &Option<String>, b: &Option<String>) -> bool {
            match (a, b) {
                (&Some(ref a), &Some(ref b)) => a.eq_ignore_ascii_case(b),
                (&None, _) => true,
                (_, &None) => false,
            }
        }
        fn matches_vec(a: &[String], b: &[String]) -> bool {
            a.iter().zip(b.iter()).all(|(x, y)| x.eq_ignore_ascii_case(y))
        }
        assert!(self.is_language_range());
        matches_option(&self.language, &other.language) &&
        matches_vec(&self.extlangs, &other.extlangs) &&
        matches_option(&self.script, &other.script) &&
        matches_option(&self.region, &other.region) &&
        matches_vec(&self.variants, &other.variants)
    }
/// Matches language tags. The first language acts as a language range, the second one is used
/// as a normal language tag. None fields in the language range are ignored. If the language
/// tag has more extlangs than the range these extlangs are ignored. Matches are
/// case-insensitive. `*` in language ranges are represented using `None` values. The language
/// range `*` that matches language tags is created by the default language tag:
/// `let wildcard: LanguageTag = Default::default();.`
///
/// For example the range `en-GB` matches only `en-GB` and `en-Arab-GB` but not `en`.
/// The range `en` matches all language tags starting with `en` including `en`, `en-GB`,
/// `en-Arab` and `en-Arab-GB`.
///
/// # Panics
/// If the language range has extensions or private use tags.
///
/// # Examples
/// ```
/// # #[macro_use] extern crate language_tags;
/// # fn main() {
/// let range_italian = langtag!(it);
/// let tag_german = langtag!(de);
/// let tag_italian_switzerland = langtag!(it;;;CH);
/// assert!(!range_italian.matches(&tag_german));
/// assert!(range_italian.matches(&tag_italian_switzerland));
///
/// let range_spanish_brazil = langtag!(es;;;BR);
/// let tag_spanish = langtag!(es);
/// assert!(!range_spanish_brazil.matches(&tag_spanish));
/// # }
/// ```
Matches language tags. The first language acts as a language range, the second one is used
as a normal language tag. None fields in the language range are ignored. If the language
tag has more extlangs than the range these extlangs are ignored. Matches are
case-insensitive. `*` in language ranges are represented using `None` values. The language
range `*` that matches language tags is created by the default language tag:
`let wildcard: LanguageTag = Default::default();.`


Matches language tags . The first language acts as a language range the second one is used as a normal language tag . None fields in the language range are ignored . If the language tag has more extlangs than the range these extlangs are ignored . Matches are case - insensitive . ` * ` in language ranges are represented using ` None ` values . The language range ` * ` that matches language tags is created by the default language tag : ` let wildcard : LanguageTag = Default :: default () ; . `
pub fn matches(&self, other: &LanguageTag) -> bool {
        fn matches_option(a: &Option<String>, b: &Option<String>) -> bool {
            match (a, b) {
                (&Some(ref a), &Some(ref b)) => a.eq_ignore_ascii_case(b),
                (&None, _) => true,
                (_, &None) => false,
            }
        }
        fn matches_vec(a: &[String], b: &[String]) -> bool {
            a.iter().zip(b.iter()).all(|(x, y)| x.eq_ignore_ascii_case(y))
        }
        assert!(self.is_language_range());
        matches_option(&self.language, &other.language) &&
        matches_vec(&self.extlangs, &other.extlangs) &&
        matches_option(&self.script, &other.script) &&
        matches_option(&self.region, &other.region) &&
        matches_vec(&self.variants, &other.variants)
    }
pub fn matches ( & self , other : & LanguageTag ) -> bool { fn matches_option ( a : & Option < String > , b : & Option < String > ) -> bool { match ( a , b ) { ( & Some ( ref a ) , & Some ( ref b ) ) => a . eq_ignore_ascii_case ( b ) , ( & None , _ ) => true , ( _ , & None ) => false , } } fn matches_vec ( a : & [ String ] , b : & [ String ] ) -> bool { a . iter ( ) . zip ( b . iter ( ) ) . all ( | ( x , y ) | x . eq_ignore_ascii_case ( y ) ) } assert ! ( self is_language_range ( ) ) ; matches_option ( & self . language , & other . language ) && matches_vec ( & self . extlangs , & other . extlangs ) && matches_option ( & self . script , & other . script ) && matches_option ( & self . region , & other . region ) && matches_vec ( & self . variants , & other . variants ) }
Matches language tags.
Matches language tags .
&self
other
&LanguageTag
&self
other
&LanguageTag
panics
If the language range has extensions or private use tags.
If the language range has extensions or private use tags .
examples
None
#[macro_use] extern crate language_tags;
None
fn main() {
let range_italian = langtag!(it);
let tag_german = langtag!(de);
let tag_italian_switzerland = langtag!(it;;;CH);
assert!(!range_italian.matches(&tag_german));
assert!(range_italian.matches(&tag_italian_switzerland)).

let range_spanish_brazil = langtag!(es;;;BR);
let tag_spanish = langtag!(es);
assert!(!range_spanish_brazil.matches(&tag_spanish)).
let range_italian = langtag! ( it ) ; let tag_german = langtag! ( de ) ; let tag_italian_switzerland = langtag! ( it ;;; CH ) ; assert! ( !range_italian . matches ( &tag_german )) ; assert! ( range_italian . matches ( &tag_italian_switzerland )) . let range_spanish_brazil = langtag! ( es ;;; BR ) ; let tag_spanish = langtag! ( es ) ; assert! ( !range_spanish_brazil . matches ( &tag_spanish )) .
}
None