diff --git a/meilisearch-core/src/bucket_sort.rs b/meilisearch-core/src/bucket_sort.rs index e94dbb623..87f518868 100644 --- a/meilisearch-core/src/bucket_sort.rs +++ b/meilisearch-core/src/bucket_sort.rs @@ -33,6 +33,7 @@ pub struct SortResult { pub exhaustive_facets_count: Option, } +#[allow(clippy::too_many_arguments)] pub fn bucket_sort<'c, FI>( reader: &heed::RoTxn, query: &str, @@ -192,6 +193,7 @@ where Ok(result) } +#[allow(clippy::too_many_arguments)] pub fn bucket_sort_with_distinct<'c, FI, FD>( reader: &heed::RoTxn, query: &str, diff --git a/meilisearch-core/src/criterion/mod.rs b/meilisearch-core/src/criterion/mod.rs index d5c291618..a2f68c28e 100644 --- a/meilisearch-core/src/criterion/mod.rs +++ b/meilisearch-core/src/criterion/mod.rs @@ -92,6 +92,7 @@ impl<'a> CriteriaBuilder<'a> { self.inner.reserve(additional) } + #[allow(clippy::should_implement_trait)] pub fn add(mut self, criterion: C) -> CriteriaBuilder<'a> where C: Criterion, diff --git a/meilisearch-core/src/criterion/typo.rs b/meilisearch-core/src/criterion/typo.rs index ca3f6212e..4b9fdea1d 100644 --- a/meilisearch-core/src/criterion/typo.rs +++ b/meilisearch-core/src/criterion/typo.rs @@ -22,6 +22,7 @@ impl Criterion for Typo { // It is safe to panic on input number higher than 3, // the number of typos is never bigger than that. #[inline] + #[allow(clippy::approx_constant)] fn custom_log10(n: u8) -> f32 { match n { 0 => 0.0, // log(1) diff --git a/meilisearch-core/src/lib.rs b/meilisearch-core/src/lib.rs index e468a794e..bcdad62b1 100644 --- a/meilisearch-core/src/lib.rs +++ b/meilisearch-core/src/lib.rs @@ -1,3 +1,5 @@ +#![allow(clippy::type_complexity)] + #[cfg(test)] #[macro_use] extern crate assert_matches; diff --git a/meilisearch-core/src/query_words_mapper.rs b/meilisearch-core/src/query_words_mapper.rs index b77ef52f4..7ff07b459 100644 --- a/meilisearch-core/src/query_words_mapper.rs +++ b/meilisearch-core/src/query_words_mapper.rs @@ -19,6 +19,7 @@ impl QueryWordsMapper { QueryWordsMapper { originals, mappings: HashMap::new() } } + #[allow(clippy::len_zero)] pub fn declare(&mut self, range: Range, id: QueryId, replacement: I) where I: IntoIterator, A: ToString, diff --git a/meilisearch-core/src/update/documents_addition.rs b/meilisearch-core/src/update/documents_addition.rs index 350f5dd35..103b5c923 100644 --- a/meilisearch-core/src/update/documents_addition.rs +++ b/meilisearch-core/src/update/documents_addition.rs @@ -109,6 +109,7 @@ pub fn push_documents_addition( Ok(last_update_id) } +#[allow(clippy::too_many_arguments)] fn index_document( writer: &mut heed::RwTxn, documents_fields: DocumentsFields, diff --git a/meilisearch-http/src/helpers/authentication.rs b/meilisearch-http/src/helpers/authentication.rs index 927665ffe..972f3880e 100644 --- a/meilisearch-http/src/helpers/authentication.rs +++ b/meilisearch-http/src/helpers/authentication.rs @@ -43,6 +43,7 @@ pub struct LoggingMiddleware { service: Rc>, } +#[allow(clippy::type_complexity)] impl Service for LoggingMiddleware where S: Service, Error = actix_web::Error> + 'static, diff --git a/meilisearch-http/src/option.rs b/meilisearch-http/src/option.rs index 264e33253..f8d9170b1 100644 --- a/meilisearch-http/src/option.rs +++ b/meilisearch-http/src/option.rs @@ -161,7 +161,7 @@ fn load_private_key(filename: PathBuf) -> Result) -> Result, Box> { let mut ret = Vec::new(); - if let &Some(ref name) = filename { + if let Some(ref name) = filename { fs::File::open(name) .map_err(|_| "cannot open ocsp file")? .read_to_end(&mut ret) diff --git a/meilisearch-http/src/routes/search.rs b/meilisearch-http/src/routes/search.rs index 9fff7d6d2..beffd8fd6 100644 --- a/meilisearch-http/src/routes/search.rs +++ b/meilisearch-http/src/routes/search.rs @@ -188,12 +188,10 @@ impl SearchQuery { for attr in &restricted_attributes { final_attributes.insert(attr.to_string()); } + } else if available_attributes.contains(attribute) { + final_attributes.insert(attribute.to_string()); } else { - if available_attributes.contains(attribute) { - final_attributes.insert(attribute.to_string()); - } else { - warn!("The attributes {:?} present in attributesToHighlight parameter doesn't exist", attribute); - } + warn!("The attributes {:?} present in attributesToHighlight parameter doesn't exist", attribute); } } @@ -246,6 +244,6 @@ fn prepare_facet_list(facets: &str, schema: &Schema, facet_attrs: &[FieldId]) -> } Ok(field_ids) } - bad_val => return Err(FacetCountError::unexpected_token(bad_val, &["[String]"])) + bad_val => Err(FacetCountError::unexpected_token(bad_val, &["[String]"])) } }