From a0e0fce677fa30338d5959dc5156ce6f0a91462a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Wed, 28 Jun 2023 14:29:12 +0200 Subject: [PATCH] Simplify a Rust lifetime trick --- milli/src/search/facet/facet_distribution.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/milli/src/search/facet/facet_distribution.rs b/milli/src/search/facet/facet_distribution.rs index cfaffed8c..acf117ef6 100644 --- a/milli/src/search/facet/facet_distribution.rs +++ b/milli/src/search/facet/facet_distribution.rs @@ -246,14 +246,13 @@ impl<'a> FacetDistribution<'a> { } _ => { let universe; - let candidates; - match &self.candidates { - Some(cnd) => candidates = cnd, + let candidates = match &self.candidates { + Some(cnd) => cnd, None => { universe = self.index.documents_ids(self.rtxn)?; - candidates = &universe; + &universe } - } + }; self.facet_numbers_distribution_from_facet_levels( field_id,