diff --git a/src/subtags.rs b/src/subtags.rs index 9127c31..b07e6a5 100644 --- a/src/subtags.rs +++ b/src/subtags.rs @@ -11,7 +11,7 @@ pub fn language_subtag(subtag: &str) -> Result<&str, ParserError> { // https://unicode.org/reports/tr35/#unicode_language_subtag // 'root' is a special case - if LANG_ROOT.eq(subtag) { + if matches!(subtag, LANG_ROOT) { return Ok(LANG_EMPTY); } @@ -19,7 +19,7 @@ pub fn language_subtag(subtag: &str) -> Result<&str, ParserError> { return Err(ParserError::InvalidLanguage); } - if LANG_UND == subtag { + if matches!(subtag, LANG_UND) { Ok(LANG_EMPTY) } else { Ok(subtag)