diff --git a/meilisearch/src/search.rs b/meilisearch/src/search.rs index 5c45e030d..239fc5c8d 100644 --- a/meilisearch/src/search.rs +++ b/meilisearch/src/search.rs @@ -582,7 +582,7 @@ pub fn perform_search( if fields.iter().all(|f| f != "*") { let fields: Vec<_> = fields - .into_iter() + .iter() .map(|n| { ( n, diff --git a/milli/src/search/facet/facet_distribution.rs b/milli/src/search/facet/facet_distribution.rs index fa6cc2fa0..cf922f646 100644 --- a/milli/src/search/facet/facet_distribution.rs +++ b/milli/src/search/facet/facet_distribution.rs @@ -296,7 +296,7 @@ impl<'a> FacetDistribution<'a> { } .into()); } else { - facets.into_iter().map(|(name, _)| name).cloned().collect() + facets.iter().map(|(name, _)| name).cloned().collect() } } None => filterable_fields, @@ -351,7 +351,7 @@ impl<'a> FacetDistribution<'a> { } .into()); } else { - facets.into_iter().map(|(name, _)| name).cloned().collect() + facets.iter().map(|(name, _)| name).cloned().collect() } } None => filterable_fields, @@ -363,8 +363,7 @@ impl<'a> FacetDistribution<'a> { let order_by = self .facets .as_ref() - .map(|facets| facets.get(name).copied()) - .flatten() + .and_then(|facets| facets.get(name).copied()) .unwrap_or(self.default_order_by); let values = self.facet_values(fid, order_by)?; distribution.insert(name.to_string(), values);