mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-24 13:40:31 +01: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> {
|
||||
if input.trim().is_empty() {
|
||||
return Ok(Self::Empty);
|
||||
}
|
||||
let span = Span::new(input);
|
||||
parse_expression::<'a, E>(span).finish().map(|(_rem, output)| output)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user