From 1f3c49e6ace7ca22814d1f292605671895fe1567 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Sat, 14 Jan 2023 13:54:56 +0100 Subject: [PATCH] id3v2: Use is_ascii_alphabetic() instead of lowercase + uppercase --- src/id3/v2/items/language_frame.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/id3/v2/items/language_frame.rs b/src/id3/v2/items/language_frame.rs index b9b27072..dab7e336 100644 --- a/src/id3/v2/items/language_frame.rs +++ b/src/id3/v2/items/language_frame.rs @@ -42,12 +42,7 @@ impl LanguageFrame { pub fn as_bytes(&self) -> Result> { let mut bytes = vec![self.encoding as u8]; - if self.language.len() != 3 - || self - .language - .iter() - .any(|c| !c.is_ascii_lowercase() && !c.is_ascii_uppercase()) - { + if self.language.len() != 3 || self.language.iter().any(|c| !c.is_ascii_alphabetic()) { return Err(ID3v2Error::new(ID3v2ErrorKind::Other( "Invalid frame language found (expected 3 ascii characters)", ))