Simplify font feature tag validation (#13548)

Simplifies the logic for the changes of #13542.

Release Notes:

- N/A
This commit is contained in:
Gilles Peiffer 2024-06-26 23:11:57 +02:00 committed by GitHub
parent 89951f7e66
commit 1260c616ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -144,13 +144,5 @@ impl schemars::JsonSchema for FontFeatures {
}
fn is_valid_feature_tag(tag: &str) -> bool {
if tag.len() != 4 {
return false;
}
for ch in tag.chars() {
if !ch.is_ascii_alphanumeric() {
return false;
}
}
true
tag.len() == 4 && tag.chars().all(|c| c.is_ascii_alphanumeric())
}