Re-order the operator

Co-authored-by: Clément Renault <clement@meilisearch.com>
This commit is contained in:
Tamo 2021-11-09 17:05:36 +01:00 committed by GitHub
parent 519d6b2bf3
commit bff48681d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,12 +46,12 @@ pub fn parse_condition(input: Span) -> IResult<FilterCondition> {
let (input, (fid, op, value)) = tuple((parse_value, operator, cut(parse_value)))(input)?; let (input, (fid, op, value)) = tuple((parse_value, operator, cut(parse_value)))(input)?;
let condition = match *op.fragment() { let condition = match *op.fragment() {
"=" => FilterCondition::Condition { fid, op: Equal(value) },
"!=" => FilterCondition::Condition { fid, op: NotEqual(value) },
">" => FilterCondition::Condition { fid, op: GreaterThan(value) },
"<" => FilterCondition::Condition { fid, op: LowerThan(value) },
"<=" => FilterCondition::Condition { fid, op: LowerThanOrEqual(value) }, "<=" => FilterCondition::Condition { fid, op: LowerThanOrEqual(value) },
">=" => FilterCondition::Condition { fid, op: GreaterThanOrEqual(value) }, ">=" => FilterCondition::Condition { fid, op: GreaterThanOrEqual(value) },
"!=" => FilterCondition::Condition { fid, op: NotEqual(value) },
"<" => FilterCondition::Condition { fid, op: LowerThan(value) },
">" => FilterCondition::Condition { fid, op: GreaterThan(value) },
"=" => FilterCondition::Condition { fid, op: Equal(value) },
_ => unreachable!(), _ => unreachable!(),
}; };