mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 12:54:26 +01:00
Avoid cloning FilterCondition in filter array parsing
This commit is contained in:
parent
8a271223a9
commit
9b6602cba2
@ -104,7 +104,7 @@ impl<'a> Filter<'a> {
|
||||
if ors.len() > 1 {
|
||||
ands.push(FilterCondition::Or(ors));
|
||||
} else if ors.len() == 1 {
|
||||
ands.push(ors[0].clone());
|
||||
ands.push(ors.pop().unwrap());
|
||||
}
|
||||
}
|
||||
Either::Right(rule) => {
|
||||
@ -117,7 +117,7 @@ impl<'a> Filter<'a> {
|
||||
let and = if ands.is_empty() {
|
||||
return Ok(None);
|
||||
} else if ands.len() == 1 {
|
||||
ands[0].clone()
|
||||
ands.pop().unwrap()
|
||||
} else {
|
||||
FilterCondition::And(ands)
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user