diff --git a/meilisearch-types/src/settings.rs b/meilisearch-types/src/settings.rs index 20705539a..3169920a6 100644 --- a/meilisearch-types/src/settings.rs +++ b/meilisearch-types/src/settings.rs @@ -11,8 +11,8 @@ use milli::update::Setting; use milli::{Criterion, CriterionError, Index, DEFAULT_VALUES_PER_FACET}; use serde::{Deserialize, Serialize, Serializer}; -use crate::error::DeserrError; -use crate::error::{deserr_codes::*, unwrap_any}; +use crate::error::deserr_codes::*; +use crate::error::{unwrap_any, DeserrError}; /// The maximimum number of results that the engine /// will be able to return in one search call. diff --git a/meilisearch/src/routes/api_key.rs b/meilisearch/src/routes/api_key.rs index c232d4802..76912bbaa 100644 --- a/meilisearch/src/routes/api_key.rs +++ b/meilisearch/src/routes/api_key.rs @@ -4,13 +4,15 @@ use actix_web::{web, HttpRequest, HttpResponse}; use deserr::DeserializeFromValue; use meilisearch_auth::error::AuthControllerError; use meilisearch_auth::AuthController; -use meilisearch_types::error::{deserr_codes::*, TakeErrorMessage}; -use meilisearch_types::error::{Code, DeserrError, ResponseError}; +use meilisearch_types::error::deserr_codes::*; +use meilisearch_types::error::{Code, DeserrError, ResponseError, TakeErrorMessage}; use meilisearch_types::keys::{Action, CreateApiKey, Key, PatchApiKey}; use serde::{Deserialize, Serialize}; use time::OffsetDateTime; use uuid::Uuid; +use super::indexes::search::parse_usize_take_error_message; +use super::PAGINATION_DEFAULT_LIMIT; use crate::extractors::authentication::policies::*; use crate::extractors::authentication::GuardedData; use crate::extractors::json::ValidatedJson; @@ -18,9 +20,6 @@ use crate::extractors::query_parameters::QueryParameter; use crate::extractors::sequential_extractor::SeqHandler; use crate::routes::Pagination; -use super::indexes::search::parse_usize_take_error_message; -use super::PAGINATION_DEFAULT_LIMIT; - pub fn configure(cfg: &mut web::ServiceConfig) { cfg.service( web::resource("") diff --git a/meilisearch/src/routes/indexes/documents.rs b/meilisearch/src/routes/indexes/documents.rs index 161882ca2..3a54bba6a 100644 --- a/meilisearch/src/routes/indexes/documents.rs +++ b/meilisearch/src/routes/indexes/documents.rs @@ -1,12 +1,6 @@ -use crate::analytics::{Analytics, DocumentDeletionKind}; -use crate::error::MeilisearchHttpError; -use crate::error::PayloadError::ReceivePayload; -use crate::extractors::authentication::policies::*; -use crate::extractors::authentication::GuardedData; -use crate::extractors::payload::Payload; -use crate::extractors::query_parameters::QueryParameter; -use crate::extractors::sequential_extractor::SeqHandler; -use crate::routes::{fold_star_or, PaginationView, SummarizedTaskView}; +use std::io::ErrorKind; +use std::num::ParseIntError; + use actix_web::http::header::CONTENT_TYPE; use actix_web::web::Data; use actix_web::{web, HttpMessage, HttpRequest, HttpResponse}; @@ -16,8 +10,8 @@ use futures::StreamExt; use index_scheduler::IndexScheduler; use log::debug; use meilisearch_types::document_formats::{read_csv, read_json, read_ndjson, PayloadType}; -use meilisearch_types::error::{deserr_codes::*, TakeErrorMessage}; -use meilisearch_types::error::{DeserrError, ResponseError}; +use meilisearch_types::error::deserr_codes::*; +use meilisearch_types::error::{DeserrError, ResponseError, TakeErrorMessage}; use meilisearch_types::heed::RoTxn; use meilisearch_types::index_uid::IndexUid; use meilisearch_types::milli::update::IndexDocumentsMethod; @@ -29,13 +23,20 @@ use once_cell::sync::Lazy; use serde::Deserialize; use serde_cs::vec::CS; use serde_json::Value; -use std::io::ErrorKind; -use std::num::ParseIntError; use tempfile::tempfile; use tokio::fs::File; use tokio::io::{AsyncSeekExt, AsyncWriteExt, BufWriter}; use super::search::parse_usize_take_error_message; +use crate::analytics::{Analytics, DocumentDeletionKind}; +use crate::error::MeilisearchHttpError; +use crate::error::PayloadError::ReceivePayload; +use crate::extractors::authentication::policies::*; +use crate::extractors::authentication::GuardedData; +use crate::extractors::payload::Payload; +use crate::extractors::query_parameters::QueryParameter; +use crate::extractors::sequential_extractor::SeqHandler; +use crate::routes::{fold_star_or, PaginationView, SummarizedTaskView}; static ACCEPTED_CONTENT_TYPE: Lazy> = Lazy::new(|| { vec!["application/json".to_string(), "application/x-ndjson".to_string(), "text/csv".to_string()] diff --git a/meilisearch/src/routes/indexes/mod.rs b/meilisearch/src/routes/indexes/mod.rs index 03289e62e..19a4dfa6c 100644 --- a/meilisearch/src/routes/indexes/mod.rs +++ b/meilisearch/src/routes/indexes/mod.rs @@ -3,8 +3,8 @@ use actix_web::{web, HttpRequest, HttpResponse}; use deserr::DeserializeFromValue; use index_scheduler::IndexScheduler; use log::debug; -use meilisearch_types::error::{deserr_codes::*, TakeErrorMessage}; -use meilisearch_types::error::{DeserrError, ResponseError}; +use meilisearch_types::error::deserr_codes::*; +use meilisearch_types::error::{DeserrError, ResponseError, TakeErrorMessage}; use meilisearch_types::index_uid::IndexUid; use meilisearch_types::milli::{self, FieldDistribution, Index}; use meilisearch_types::tasks::KindWithContent; @@ -13,7 +13,6 @@ use serde_json::json; use time::OffsetDateTime; use self::search::parse_usize_take_error_message; - use super::{Pagination, SummarizedTaskView, PAGINATION_DEFAULT_LIMIT}; use crate::analytics::Analytics; use crate::extractors::authentication::policies::*; diff --git a/meilisearch/src/routes/mod.rs b/meilisearch/src/routes/mod.rs index 28d3e997e..2e619540a 100644 --- a/meilisearch/src/routes/mod.rs +++ b/meilisearch/src/routes/mod.rs @@ -1,10 +1,6 @@ use std::collections::BTreeMap; use std::str::FromStr; -use self::indexes::IndexStats; -use crate::analytics::Analytics; -use crate::extractors::authentication::policies::*; -use crate::extractors::authentication::GuardedData; use actix_web::web::Data; use actix_web::{web, HttpRequest, HttpResponse}; use index_scheduler::{IndexScheduler, Query}; @@ -17,6 +13,11 @@ use serde::{Deserialize, Serialize}; use serde_json::json; use time::OffsetDateTime; +use self::indexes::IndexStats; +use crate::analytics::Analytics; +use crate::extractors::authentication::policies::*; +use crate::extractors::authentication::GuardedData; + mod api_key; mod dump; pub mod indexes; diff --git a/meilisearch/src/search.rs b/meilisearch/src/search.rs index 12e18a09c..7f8af5fd1 100644 --- a/meilisearch/src/search.rs +++ b/meilisearch/src/search.rs @@ -5,7 +5,8 @@ use std::time::Instant; use deserr::DeserializeFromValue; use either::Either; -use meilisearch_types::error::{deserr_codes::*, DeserrError}; +use meilisearch_types::error::deserr_codes::*; +use meilisearch_types::error::DeserrError; use meilisearch_types::settings::DEFAULT_PAGINATION_MAX_TOTAL_HITS; use meilisearch_types::{milli, Document}; use milli::tokenizer::TokenizerBuilder;