mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
handle the case of empty input
This commit is contained in:
parent
e25ca9776f
commit
4e113bbf1b
@ -91,6 +91,9 @@ impl<'a> FilterCondition<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse<E: FPError<'a>>(input: &'a str) -> Result<Self, E> {
|
pub fn parse<E: FPError<'a>>(input: &'a str) -> Result<Self, E> {
|
||||||
|
if input.trim().is_empty() {
|
||||||
|
return Ok(Self::Empty);
|
||||||
|
}
|
||||||
let span = Span::new(input);
|
let span = Span::new(input);
|
||||||
parse_expression::<'a, E>(span).finish().map(|(_rem, output)| output)
|
parse_expression::<'a, E>(span).finish().map(|(_rem, output)| output)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user