From 9c36e497d9bbfd9da2a8a6cbe5776128da413683 Mon Sep 17 00:00:00 2001 From: Tamo Date: Tue, 9 Nov 2021 00:58:23 +0100 Subject: [PATCH] Rename the key_component into a value_component Co-authored-by: marin --- filter_parser/src/value.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filter_parser/src/value.rs b/filter_parser/src/value.rs index b716dab66..b9d929ab0 100644 --- a/filter_parser/src/value.rs +++ b/filter_parser/src/value.rs @@ -35,7 +35,7 @@ pub fn parse_value(input: Span) -> IResult { // doubleQuoted = "\"" (word | spaces)* "\"" let double_quoted = take_till(|c: char| c == '"'); // word = (alphanumeric | _ | - | .)+ - let word = take_while1(is_key_component); + let word = take_while1(is_value_component); // this parser is only used when an error is encountered and it parse the // largest string possible that do not contain any “language” syntax. @@ -65,7 +65,7 @@ pub fn parse_value(input: Span) -> IResult { }) } -fn is_key_component(c: char) -> bool { +fn is_value_component(c: char) -> bool { c.is_alphanumeric() || ['_', '-', '.'].contains(&c) }