From d1f34f926e90cc6b10b4d7bd37a7cbe9731181a6 Mon Sep 17 00:00:00 2001 From: Jean SIMARD Date: Mon, 30 Nov 2020 17:41:01 +0100 Subject: [PATCH] [ci] Add all target to check --- .github/workflows/test.yml | 1 + meilisearch-core/examples/from_file.rs | 7 +++++-- meilisearch-core/src/query_tree.rs | 2 +- meilisearch-http/src/helpers/authentication.rs | 2 +- meilisearch-http/src/routes/document.rs | 2 +- meilisearch-http/tests/dump.rs | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 14bf03e47..ddc8150b6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: clippy + args: --all-targets -- --deny warnings build-image: name: Test the build of Docker image diff --git a/meilisearch-core/examples/from_file.rs b/meilisearch-core/examples/from_file.rs index 3728ec864..beb1028e2 100644 --- a/meilisearch-core/examples/from_file.rs +++ b/meilisearch-core/examples/from_file.rs @@ -326,8 +326,11 @@ fn search_command(command: SearchCommand, database: Database) -> Result<(), Box< let schema = schema.ok_or(meilisearch_core::Error::SchemaMissing)?; - let fields = command.displayed_fields.iter().map(String::as_str); - let fields = HashSet::from_iter(fields); + let fields = command + .displayed_fields + .iter() + .map(String::as_str) + .collect::>(); let config = Config::builder().auto_add_history(true).build(); let mut readline = Editor::<()>::with_config(config); diff --git a/meilisearch-core/src/query_tree.rs b/meilisearch-core/src/query_tree.rs index 5d10e9bef..7255ef3db 100644 --- a/meilisearch-core/src/query_tree.rs +++ b/meilisearch-core/src/query_tree.rs @@ -176,7 +176,7 @@ where I: IntoIterator, const MAX_NGRAM: usize = 3; -fn split_query_string<'a, A: AsRef<[u8]>>(s: &str, stop_words: &'a fst::Set) -> Vec<(usize, String)> { +fn split_query_string>(s: &str, stop_words: &fst::Set) -> Vec<(usize, String)> { // TODO: Use global instance instead Analyzer::new(AnalyzerConfig::default_with_stopwords(stop_words)) .analyze(s) diff --git a/meilisearch-http/src/helpers/authentication.rs b/meilisearch-http/src/helpers/authentication.rs index 1c67df70a..c33d6cde3 100644 --- a/meilisearch-http/src/helpers/authentication.rs +++ b/meilisearch-http/src/helpers/authentication.rs @@ -101,7 +101,7 @@ where } else { let error = ResponseError::from(Error::InvalidToken(auth_header.to_string())).error_response(); let (request, _) = req.into_parts(); - return Box::pin(ok(ServiceResponse::new(request, error))) + Box::pin(ok(ServiceResponse::new(request, error))) } } } diff --git a/meilisearch-http/src/routes/document.rs b/meilisearch-http/src/routes/document.rs index 943351bd7..e529839c7 100644 --- a/meilisearch-http/src/routes/document.rs +++ b/meilisearch-http/src/routes/document.rs @@ -175,7 +175,7 @@ async fn update_multiple_documents( .ok_or(meilisearch_core::Error::SchemaMissing)?; match (params.into_inner().primary_key, schema.primary_key()) { - (Some(_), Some(_)) => return Err(meilisearch_schema::Error::PrimaryKeyAlreadyPresent)?, + (Some(_), Some(_)) => return Err(meilisearch_schema::Error::PrimaryKeyAlreadyPresent.into()), (Some(key), None) => document_addition.set_primary_key(key), (None, None) => { let key = body diff --git a/meilisearch-http/tests/dump.rs b/meilisearch-http/tests/dump.rs index 466dc32f5..e50be866a 100644 --- a/meilisearch-http/tests/dump.rs +++ b/meilisearch-http/tests/dump.rs @@ -16,7 +16,7 @@ async fn trigger_and_wait_dump(server: &mut common::Server) -> String { let dump_uid = value["uid"].as_str().unwrap().to_string(); - for _ in 0..20 as u8 { + for _ in 0..20_u8 { let (value, status_code) = server.get_dump_status(&dump_uid).await; assert_eq!(status_code, 200);