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 17:11:57 -04:00
committed by GitHub
parent 89951f7e66
commit 1260c616ba
+1 -9
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())
}