mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-27 07:14:26 +01: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
|
/// condition = value ("==" | ">" ...) value
|
||||||
pub fn parse_condition(input: Span) -> IResult<FilterCondition> {
|
pub fn parse_condition(input: Span) -> IResult<FilterCondition> {
|
||||||
let operator = alt((tag("<="), tag(">="), tag("!="), tag("<"), tag(">"), tag("=")));
|
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() {
|
match *op.fragment() {
|
||||||
"=" => {
|
"=" => {
|
||||||
@ -73,7 +72,7 @@ pub fn parse_condition(input: Span) -> IResult<FilterCondition> {
|
|||||||
/// to = value value TO value
|
/// to = value value TO value
|
||||||
pub fn parse_to(input: Span) -> IResult<FilterCondition> {
|
pub fn parse_to(input: Span) -> IResult<FilterCondition> {
|
||||||
let (input, (key, from, _, to)) =
|
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((
|
Ok((
|
||||||
input,
|
input,
|
||||||
|
@ -28,9 +28,9 @@ pub fn parse_value(input: Span) -> IResult<Token> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// singleQuoted = "'" .* all but quotes "'"
|
// 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)* "\""
|
// doubleQuoted = "\"" (word | spaces)* "\""
|
||||||
let double_quoted = |input| take_till(|c: char| c == '"')(input);
|
let double_quoted = take_till(|c: char| c == '"');
|
||||||
// word = (alphanumeric | _ | - | .)+
|
// word = (alphanumeric | _ | - | .)+
|
||||||
let word = take_while1(is_key_component);
|
let word = take_while1(is_key_component);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user