mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-27 07:14:26 +01:00
improve the readability of the _geoPoint thingy in the value
This commit is contained in:
parent
ea52aff6dc
commit
6515838d35
@ -13,10 +13,13 @@ pub fn parse_value(input: Span) -> IResult<Token> {
|
|||||||
let (input, _) = take_while(char::is_whitespace)(input)?;
|
let (input, _) = take_while(char::is_whitespace)(input)?;
|
||||||
|
|
||||||
// then, we want to check if the user is misusing a geo expression
|
// then, we want to check if the user is misusing a geo expression
|
||||||
let err = parse_geo_point(input).unwrap_err();
|
// This expression can’t finish without error.
|
||||||
|
// We want to return an error in case of failure.
|
||||||
|
if let Err(err) = parse_geo_point(input) {
|
||||||
if err.is_failure() {
|
if err.is_failure() {
|
||||||
return Err(err);
|
return Err(err);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
match parse_geo_radius(input) {
|
match parse_geo_radius(input) {
|
||||||
Ok(_) => return Err(nom::Err::Failure(Error::new_from_kind(input, ErrorKind::MisusedGeo))),
|
Ok(_) => return Err(nom::Err::Failure(Error::new_from_kind(input, ErrorKind::MisusedGeo))),
|
||||||
// if we encountered a failure it means the user badly wrote a _geoRadius filter.
|
// if we encountered a failure it means the user badly wrote a _geoRadius filter.
|
||||||
|
Loading…
Reference in New Issue
Block a user