From 66dbd3cd341c50a3fbb4de09935db1553e904e60 Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 6 Oct 2021 12:33:25 +0200 Subject: [PATCH] makes clippy happy --- meilisearch-http/src/routes/indexes/documents.rs | 2 +- meilisearch-http/tests/content_type.rs | 4 +++- meilisearch-lib/src/index_controller/dump_actor/loaders/v2.rs | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/meilisearch-http/src/routes/indexes/documents.rs b/meilisearch-http/src/routes/indexes/documents.rs index b3163f543..e890bab24 100644 --- a/meilisearch-http/src/routes/indexes/documents.rs +++ b/meilisearch-http/src/routes/indexes/documents.rs @@ -177,7 +177,7 @@ async fn document_addition( body: Payload, method: IndexDocumentsMethod, ) -> Result { - const ACCEPTED_CONTENT_TYPE: Lazy> = Lazy::new(|| { + static ACCEPTED_CONTENT_TYPE: Lazy> = Lazy::new(|| { vec![ "application/json".to_string(), "application/x-ndjson".to_string(), diff --git a/meilisearch-http/tests/content_type.rs b/meilisearch-http/tests/content_type.rs index d548777f4..5402a7cd6 100644 --- a/meilisearch-http/tests/content_type.rs +++ b/meilisearch-http/tests/content_type.rs @@ -1,6 +1,8 @@ +#![allow(dead_code)] + mod common; -use crate::common::{GetAllDocumentsOptions, Server}; +use crate::common::Server; use actix_web::test; use meilisearch_http::create_app; use serde_json::{json, Value}; diff --git a/meilisearch-lib/src/index_controller/dump_actor/loaders/v2.rs b/meilisearch-lib/src/index_controller/dump_actor/loaders/v2.rs index 0040d4cea..35640aaef 100644 --- a/meilisearch-lib/src/index_controller/dump_actor/loaders/v2.rs +++ b/meilisearch-lib/src/index_controller/dump_actor/loaders/v2.rs @@ -4,7 +4,6 @@ use std::path::{Path, PathBuf}; use serde_json::{Deserializer, Value}; use tempfile::NamedTempFile; -use uuid::Uuid; use crate::index_controller::dump_actor::loaders::compat::{asc_ranking_rule, desc_ranking_rule}; use crate::index_controller::dump_actor::Metadata; @@ -200,7 +199,7 @@ impl From for Enqueued { method, // Just ignore if the uuid is no present. If it is needed later, an error will // be thrown. - content_uuid: content.unwrap_or_else(Uuid::default), + content_uuid: content.unwrap_or_default(), } } compat::UpdateMeta::ClearDocuments => Update::ClearDocuments,