mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-13 22:22:31 +00:00
id3v2: Use is_ascii_alphabetic() instead of lowercase + uppercase
This commit is contained in:
parent
4f31729ae8
commit
1f3c49e6ac
1 changed files with 1 additions and 6 deletions
|
@ -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)",
|
||||
))
|
||||
|
|
Loading…
Reference in a new issue