mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
handle the case of empty input
This commit is contained in:
parent
e25ca9776f
commit
4e113bbf1b
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue