From 1260c616ba989a38eff71caec285ac5ef70eb094 Mon Sep 17 00:00:00 2001 From: Gilles Peiffer Date: Wed, 26 Jun 2024 23:11:57 +0200 Subject: [PATCH] Simplify font feature tag validation (#13548) Simplifies the logic for the changes of #13542. Release Notes: - N/A --- crates/gpui/src/text_system/font_features.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/crates/gpui/src/text_system/font_features.rs b/crates/gpui/src/text_system/font_features.rs index db48db62ef..d9da15686c 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()) }