Skip to content

Commit

Permalink
minor: Use slice reference for parser list
Browse files Browse the repository at this point in the history
With the reference we don't need to update the number of entries when
we add a parser. Tip taken from nucleo's `case_fold` module via Pascal.
  • Loading branch information
the-mikedavis committed Aug 19, 2024
1 parent 70c9af5 commit 883792f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/aff/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct AffLineParser<'aff> {
type Parser = for<'aff> fn(&mut AffLineParser<'aff>, &mut Lines<'aff>) -> ParseResult;

// These parsers are only used for the `.aff` file's contents. The `.dic` file is handled ad-hoc.
const AFF_PARSERS: [(&str, Parser); 48] = [
const AFF_PARSERS: &[(&str, Parser)] = &[
("FLAG", parse_flag_type),
// Flags
("FORBIDDENWORD", parse_forbidden_word_flag),
Expand Down

0 comments on commit 883792f

Please sign in to comment.