From 2d66fdc8e91a8fdec18aff8d3dfddfbcb6fbc91a Mon Sep 17 00:00:00 2001 From: Guillaume Mourier Date: Tue, 1 Nov 2022 09:56:38 +0100 Subject: [PATCH] Apply review comments --- filter-parser/src/error.rs | 2 +- filter-parser/src/lib.rs | 1 - filter-parser/src/value.rs | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/filter-parser/src/error.rs b/filter-parser/src/error.rs index 70018c3d9..0e416091f 100644 --- a/filter-parser/src/error.rs +++ b/filter-parser/src/error.rs @@ -156,7 +156,7 @@ impl<'a> Display for Error<'a> { writeln!(f, "The `_geoRadius` filter expects three arguments: `_geoRadius(latitude, longitude, radius)`.")? } ErrorKind::GeoBoundingBox => { - writeln!(f, "The `_geoBoundingBox` filter expects two pair of arguments: `_geoBoundingBox((latitude, longitude), (latitude, longitude))`.")? + writeln!(f, "The `_geoBoundingBox` filter expects two pairs of arguments: `_geoBoundingBox((latitude, longitude), (latitude, longitude))`.")? } ErrorKind::ReservedGeo(name) => { writeln!(f, "`{}` is a reserved keyword and thus can't be used as a filter expression. Use the `_geoRadius(latitude, longitude, distance), or _geoBoundingBox((latitude, longitude), (latitude, longitude)) built-in rules to filter on `_geo` coordinates.", name.escape_debug())? diff --git a/filter-parser/src/lib.rs b/filter-parser/src/lib.rs index d30c1b58e..3e1c8baea 100644 --- a/filter-parser/src/lib.rs +++ b/filter-parser/src/lib.rs @@ -351,7 +351,6 @@ fn parse_geo_bounding_box(input: Span) -> IResult { return Err(nom::Err::Failure(Error::new_from_kind(input, ErrorKind::GeoBoundingBox))); } - //TODO: Check sub array length let res = FilterCondition::GeoBoundingBox { top_left_point: [args[0][0].into(), args[0][1].into()], bottom_right_point: [args[1][0].into(), args[1][1].into()], diff --git a/filter-parser/src/value.rs b/filter-parser/src/value.rs index d08a12a92..2296c0769 100644 --- a/filter-parser/src/value.rs +++ b/filter-parser/src/value.rs @@ -98,7 +98,7 @@ pub fn parse_value(input: Span) -> IResult { return Err(nom::Err::Failure(Error::new_from_kind(input, ErrorKind::MisusedGeoRadius))) } // if we encountered a failure it means the user badly wrote a _geoRadius filter. - // But instead of showing him how to fix his syntax we are going to tell him he should not use this filter as a value. + // But instead of showing them how to fix his syntax we are going to tell them they should not use this filter as a value. Err(e) if e.is_failure() => { return Err(nom::Err::Failure(Error::new_from_kind(input, ErrorKind::MisusedGeoRadius))) } @@ -113,7 +113,7 @@ pub fn parse_value(input: Span) -> IResult { ))) } // if we encountered a failure it means the user badly wrote a _geoBoundingBox filter. - // But instead of showing him how to fix his syntax we are going to tell him he should not use this filter as a value. + // But instead of showing them how to fix his syntax we are going to tell them they should not use this filter as a value. Err(e) if e.is_failure() => { return Err(nom::Err::Failure(Error::new_from_kind( input,