id3v2: Use is_ascii_alphabetic() instead of lowercase + uppercase

This commit is contained in:
Uwe Klotz 2023-01-14 13:54:56 +01:00 committed by Alex
parent 4f31729ae8
commit 1f3c49e6ac

View file

@ -42,12 +42,7 @@ impl LanguageFrame {
pub fn as_bytes(&self) -> Result<Vec<u8>> {
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)",
))