Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Simplify font feature tag validation (#13548)

Gilles Peiffer1260c616ba98
diff --git a/crates/gpui/src/text_system/font_features.rs b/crates/gpui/src/text_system/font_features.rs
index db48db62ef2..d9da15686c9 100644
--- a/crates/gpui/src/text_system/font_features.rs
+++ b/crates/gpui/src/text_system/font_features.rs
@@ -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())
}