diff --git a/milli/src/search/distinct/facet_distinct.rs b/milli/src/search/distinct/facet_distinct.rs index 322843ee0..de7b28141 100644 --- a/milli/src/search/distinct/facet_distinct.rs +++ b/milli/src/search/distinct/facet_distinct.rs @@ -172,7 +172,7 @@ impl DocIter for FacetDistinctIter<'_> { } } -impl<'a> Distinct<'_> for FacetDistinct<'a> { +impl<'a> Distinct for FacetDistinct<'a> { type Iter = FacetDistinctIter<'a>; fn distinct(&mut self, candidates: RoaringBitmap, excluded: RoaringBitmap) -> Self::Iter { diff --git a/milli/src/search/distinct/mod.rs b/milli/src/search/distinct/mod.rs index 68a94ed48..945beb7e6 100644 --- a/milli/src/search/distinct/mod.rs +++ b/milli/src/search/distinct/mod.rs @@ -18,10 +18,10 @@ pub trait DocIter: Iterator> { /// must return an iterator containing only distinct documents, and add the discarded documents to /// the excluded set. The excluded set can later be retrieved by calling `DocIter::excluded` on the /// returned iterator. -pub trait Distinct<'a> { +pub trait Distinct { type Iter: DocIter; - fn distinct(&'a mut self, candidates: RoaringBitmap, excluded: RoaringBitmap) -> Self::Iter; + fn distinct(&mut self, candidates: RoaringBitmap, excluded: RoaringBitmap) -> Self::Iter; } #[cfg(test)] diff --git a/milli/src/search/distinct/noop_distinct.rs b/milli/src/search/distinct/noop_distinct.rs index 3de9be631..bfaafed85 100644 --- a/milli/src/search/distinct/noop_distinct.rs +++ b/milli/src/search/distinct/noop_distinct.rs @@ -26,7 +26,7 @@ impl DocIter for NoopDistinctIter { } } -impl Distinct<'_> for NoopDistinct { +impl Distinct for NoopDistinct { type Iter = NoopDistinctIter; fn distinct(&mut self, candidates: RoaringBitmap, excluded: RoaringBitmap) -> Self::Iter { diff --git a/milli/src/search/mod.rs b/milli/src/search/mod.rs index 36a155290..11f56b7a6 100644 --- a/milli/src/search/mod.rs +++ b/milli/src/search/mod.rs @@ -147,12 +147,13 @@ impl<'a> Search<'a> { } } - fn perform_sort( + fn perform_sort( &self, - mut distinct: impl for<'c> Distinct<'c>, + mut distinct: D, matching_words: MatchingWords, mut criteria: Final, - ) -> anyhow::Result { + ) -> anyhow::Result + { let mut offset = self.offset; let mut initial_candidates = RoaringBitmap::new(); let mut excluded_candidates = RoaringBitmap::new();