From 3206262282f9f4d0b87398947b8d9957217c7232 Mon Sep 17 00:00:00 2001 From: Gwen Lg Date: Wed, 12 Jun 2024 17:38:09 +0200 Subject: [PATCH] handle multiples character in flag parsing flag allow multiple characters, but only the first one was take. In fr hunspell dictionary, `()`, `{}`, `||`, `--` are used as flags. This change create a String with all characters, not only the first on. Without this change, the french dictionary failed to load. --- zspell/src/affix/parse.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zspell/src/affix/parse.rs b/zspell/src/affix/parse.rs index 297f1eb..b152592 100644 --- a/zspell/src/affix/parse.rs +++ b/zspell/src/affix/parse.rs @@ -137,7 +137,7 @@ where // Max length is 10 for u32::max. We will validate our flag later if count <= 10 && valid { - Ok(f(s.chars().next().unwrap().to_string())) + Ok(f(s.to_string())) } else { Err(ParseError::new_nospan(ParseErrorKind::InvalidFlag, s)) }