mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
Remove useless closure
Co-authored-by: marin <postma.marin@protonmail.com>
This commit is contained in:
parent
21d115dcbb
commit
15bd14297e
@ -43,9 +43,8 @@ impl<'a> Condition<'a> {
|
||||
/// condition = value ("==" | ">" ...) value
|
||||
pub fn parse_condition(input: Span) -> IResult<FilterCondition> {
|
||||
let operator = alt((tag("<="), tag(">="), tag("!="), tag("<"), tag(">"), tag("=")));
|
||||
let (input, (key, op, value)) = tuple((|c| parse_value(c), operator, cut(parse_value)))(input)?;
|
||||
let (input, (fid, op, value)) = tuple((parse_value, operator, cut(parse_value)))(input)?;
|
||||
|
||||
let fid = key;
|
||||
|
||||
match *op.fragment() {
|
||||
"=" => {
|
||||
@ -73,7 +72,7 @@ pub fn parse_condition(input: Span) -> IResult<FilterCondition> {
|
||||
/// to = value value TO value
|
||||
pub fn parse_to(input: Span) -> IResult<FilterCondition> {
|
||||
let (input, (key, from, _, to)) =
|
||||
tuple((|c| parse_value(c), |c| parse_value(c), tag("TO"), cut(parse_value)))(input)?;
|
||||
tuple((parse_value, parse_value, tag("TO"), cut(parse_value)))(input)?;
|
||||
|
||||
Ok((
|
||||
input,
|
||||
|
@ -28,9 +28,9 @@ pub fn parse_value(input: Span) -> IResult<Token> {
|
||||
}
|
||||
|
||||
// singleQuoted = "'" .* all but quotes "'"
|
||||
let simple_quoted = |input| take_till(|c: char| c == '\'')(input);
|
||||
let simple_quoted = take_till(|c: char| c == '\'');
|
||||
// doubleQuoted = "\"" (word | spaces)* "\""
|
||||
let double_quoted = |input| take_till(|c: char| c == '"')(input);
|
||||
let double_quoted = take_till(|c: char| c == '"');
|
||||
// word = (alphanumeric | _ | - | .)+
|
||||
let word = take_while1(is_key_component);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user