mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01:00
remove useless lifetime on Distinct Trait
This commit is contained in:
parent
187c713de5
commit
1e366dae3e
@ -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 {
|
||||
|
@ -18,10 +18,10 @@ pub trait DocIter: Iterator<Item = anyhow::Result<DocumentId>> {
|
||||
/// 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)]
|
||||
|
@ -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 {
|
||||
|
@ -147,12 +147,13 @@ impl<'a> Search<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
fn perform_sort(
|
||||
fn perform_sort<D: Distinct>(
|
||||
&self,
|
||||
mut distinct: impl for<'c> Distinct<'c>,
|
||||
mut distinct: D,
|
||||
matching_words: MatchingWords,
|
||||
mut criteria: Final,
|
||||
) -> anyhow::Result<SearchResult> {
|
||||
) -> anyhow::Result<SearchResult>
|
||||
{
|
||||
let mut offset = self.offset;
|
||||
let mut initial_candidates = RoaringBitmap::new();
|
||||
let mut excluded_candidates = RoaringBitmap::new();
|
||||
|
Loading…
Reference in New Issue
Block a user