Skip to content

Commit

Permalink
handle multiples character in flag parsing
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gwen-lg committed Jun 12, 2024
1 parent 550cbc3 commit 3206262
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zspell/src/affix/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 3206262

Please sign in to comment.