From 3296cf7ae6c36b4784cb14b70d49f41aaedd369e Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Mon, 30 Jan 2023 17:18:02 +0100 Subject: [PATCH] clippy: remove needless lifetimes --- index-scheduler/src/batch.rs | 4 ++-- meilisearch/src/search.rs | 8 ++++---- milli/src/index.rs | 6 +++--- milli/src/search/criteria/proximity.rs | 16 ++++++++-------- milli/src/search/criteria/typo.rs | 12 ++++++------ milli/src/update/delete_documents.rs | 6 +++--- milli/src/update/facet/incremental.rs | 24 ++++++++++++------------ 7 files changed, 38 insertions(+), 38 deletions(-) diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index 423e2f23d..e7e52c7c3 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -947,9 +947,9 @@ impl IndexScheduler { /// /// ## Return /// The list of processed tasks. - fn apply_index_operation<'txn, 'i>( + fn apply_index_operation<'i>( &self, - index_wtxn: &'txn mut RwTxn<'i, '_>, + index_wtxn: &'_ mut RwTxn<'i, '_>, index: &'i Index, operation: IndexOperation, ) -> Result> { diff --git a/meilisearch/src/search.rs b/meilisearch/src/search.rs index a3972cd38..9e4d81ffd 100644 --- a/meilisearch/src/search.rs +++ b/meilisearch/src/search.rs @@ -474,10 +474,10 @@ fn make_document( Ok(document) } -fn format_fields<'a, A: AsRef<[u8]>>( +fn format_fields>( document: &Document, field_ids_map: &FieldsIdsMap, - builder: &MatcherBuilder<'a, A>, + builder: &MatcherBuilder<'_, A>, formatted_options: &BTreeMap, compute_matches: bool, displayable_ids: &BTreeSet, @@ -522,9 +522,9 @@ fn format_fields<'a, A: AsRef<[u8]>>( Ok((matches_position, document)) } -fn format_value<'a, A: AsRef<[u8]>>( +fn format_value>( value: Value, - builder: &MatcherBuilder<'a, A>, + builder: &MatcherBuilder<'_, A>, format_options: Option, infos: &mut Vec, compute_matches: bool, diff --git a/milli/src/index.rs b/milli/src/index.rs index 3f7ef14e6..31311d318 100644 --- a/milli/src/index.rs +++ b/milli/src/index.rs @@ -348,10 +348,10 @@ impl Index { /* external documents ids */ /// Writes the external documents ids and internal ids (i.e. `u32`). - pub(crate) fn put_external_documents_ids<'a>( + pub(crate) fn put_external_documents_ids( &self, wtxn: &mut RwTxn, - external_documents_ids: &ExternalDocumentsIds<'a>, + external_documents_ids: &ExternalDocumentsIds<'_>, ) -> heed::Result<()> { let ExternalDocumentsIds { hard, soft, .. } = external_documents_ids; let hard = hard.as_fst().as_bytes(); @@ -426,7 +426,7 @@ impl Index { } /// Returns the `rtree` which associates coordinates to documents ids. - pub fn geo_rtree<'t>(&self, rtxn: &'t RoTxn) -> Result>> { + pub fn geo_rtree(&self, rtxn: &'_ RoTxn) -> Result>> { match self .main .get::<_, Str, SerdeBincode>>(rtxn, main_key::GEO_RTREE_KEY)? diff --git a/milli/src/search/criteria/proximity.rs b/milli/src/search/criteria/proximity.rs index 66e5c95bf..0f5b340bf 100644 --- a/milli/src/search/criteria/proximity.rs +++ b/milli/src/search/criteria/proximity.rs @@ -182,15 +182,15 @@ impl<'t> Criterion for Proximity<'t> { } } -fn resolve_candidates<'t>( - ctx: &'t dyn Context, +fn resolve_candidates( + ctx: &'_ dyn Context, query_tree: &Operation, proximity: u8, cache: &mut Cache, wdcache: &mut WordDerivationsCache, ) -> Result { - fn resolve_operation<'t>( - ctx: &'t dyn Context, + fn resolve_operation( + ctx: &'_ dyn Context, query_tree: &Operation, proximity: u8, cache: &mut Cache, @@ -243,8 +243,8 @@ fn resolve_candidates<'t>( Ok(result) } - fn mdfs_pair<'t>( - ctx: &'t dyn Context, + fn mdfs_pair( + ctx: &'_ dyn Context, left: &Operation, right: &Operation, proximity: u8, @@ -298,8 +298,8 @@ fn resolve_candidates<'t>( Ok(output) } - fn mdfs<'t>( - ctx: &'t dyn Context, + fn mdfs( + ctx: &'_ dyn Context, branches: &[Operation], proximity: u8, cache: &mut Cache, diff --git a/milli/src/search/criteria/typo.rs b/milli/src/search/criteria/typo.rs index 911d46e3e..95e722074 100644 --- a/milli/src/search/criteria/typo.rs +++ b/milli/src/search/criteria/typo.rs @@ -239,15 +239,15 @@ fn alterate_query_tree( Ok(query_tree) } -fn resolve_candidates<'t>( - ctx: &'t dyn Context, +fn resolve_candidates( + ctx: &'_ dyn Context, query_tree: &Operation, number_typos: u8, cache: &mut HashMap<(Operation, u8), RoaringBitmap>, wdcache: &mut WordDerivationsCache, ) -> Result { - fn resolve_operation<'t>( - ctx: &'t dyn Context, + fn resolve_operation( + ctx: &'_ dyn Context, query_tree: &Operation, number_typos: u8, cache: &mut HashMap<(Operation, u8), RoaringBitmap>, @@ -276,8 +276,8 @@ fn resolve_candidates<'t>( } } - fn mdfs<'t>( - ctx: &'t dyn Context, + fn mdfs( + ctx: &'_ dyn Context, branches: &[Operation], mana: u8, cache: &mut HashMap<(Operation, u8), RoaringBitmap>, diff --git a/milli/src/update/delete_documents.rs b/milli/src/update/delete_documents.rs index f4a6d396e..4ba7eb08f 100644 --- a/milli/src/update/delete_documents.rs +++ b/milli/src/update/delete_documents.rs @@ -574,9 +574,9 @@ fn remove_from_word_docids( Ok(()) } -fn remove_docids_from_field_id_docid_facet_value<'i, 'a>( - index: &'i Index, - wtxn: &'a mut heed::RwTxn, +fn remove_docids_from_field_id_docid_facet_value( + index: &'_ Index, + wtxn: &'_ mut heed::RwTxn, facet_type: FacetType, field_id: FieldId, to_remove: &RoaringBitmap, diff --git a/milli/src/update/facet/incremental.rs b/milli/src/update/facet/incremental.rs index abe83be7a..d5f09c783 100644 --- a/milli/src/update/facet/incremental.rs +++ b/milli/src/update/facet/incremental.rs @@ -157,9 +157,9 @@ impl FacetsUpdateIncrementalInner { /// /// ## Return /// See documentation of `insert_in_level` - fn insert_in_level_0<'t>( + fn insert_in_level_0( &self, - txn: &'t mut RwTxn, + txn: &'_ mut RwTxn, field_id: u16, facet_value: &[u8], docids: &RoaringBitmap, @@ -211,9 +211,9 @@ impl FacetsUpdateIncrementalInner { /// - `InsertionResult::Insert` means that inserting the `facet_value` into the `level` resulted /// in the addition of a new key in that level, and that therefore the number of children /// of the parent node should be incremented. - fn insert_in_level<'t>( + fn insert_in_level( &self, - txn: &'t mut RwTxn, + txn: &'_ mut RwTxn, field_id: u16, level: u8, facet_value: &[u8], @@ -348,9 +348,9 @@ impl FacetsUpdateIncrementalInner { } /// Insert the given facet value and corresponding document ids in the database. - pub fn insert<'t>( + pub fn insert( &self, - txn: &'t mut RwTxn, + txn: &'_ mut RwTxn, field_id: u16, facet_value: &[u8], docids: &RoaringBitmap, @@ -470,9 +470,9 @@ impl FacetsUpdateIncrementalInner { /// in level 1, the key with the left bound `3` had to be changed to the next facet value (e.g. 4). /// In that case `DeletionResult::Reduce` is returned. The parent of the reduced key may need to adjust /// its left bound as well. - fn delete_in_level<'t>( + fn delete_in_level( &self, - txn: &'t mut RwTxn, + txn: &'_ mut RwTxn, field_id: u16, level: u8, facet_value: &[u8], @@ -529,9 +529,9 @@ impl FacetsUpdateIncrementalInner { } } - fn delete_in_level_0<'t>( + fn delete_in_level_0( &self, - txn: &'t mut RwTxn, + txn: &'_ mut RwTxn, field_id: u16, facet_value: &[u8], docids: &RoaringBitmap, @@ -557,9 +557,9 @@ impl FacetsUpdateIncrementalInner { } } - pub fn delete<'t>( + pub fn delete( &self, - txn: &'t mut RwTxn, + txn: &'_ mut RwTxn, field_id: u16, facet_value: &[u8], docids: &RoaringBitmap,