From b781f9a0f911f471ca06728f401e2439529346c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Lecrenier?= Date: Tue, 17 Jan 2023 11:05:01 +0100 Subject: [PATCH] cargo fmt --- meilisearch-types/src/keys.rs | 4 ++-- meilisearch-types/src/lib.rs | 5 ++--- meilisearch-types/src/settings.rs | 2 +- meilisearch-types/src/star_or.rs | 10 +++++++--- meilisearch/src/routes/indexes/mod.rs | 4 ++-- meilisearch/src/routes/indexes/search.rs | 2 +- meilisearch/src/routes/tasks.rs | 4 ++-- 7 files changed, 17 insertions(+), 14 deletions(-) diff --git a/meilisearch-types/src/keys.rs b/meilisearch-types/src/keys.rs index ea941b775..655af9b31 100644 --- a/meilisearch-types/src/keys.rs +++ b/meilisearch-types/src/keys.rs @@ -11,8 +11,8 @@ use time::{Date, OffsetDateTime, PrimitiveDateTime}; use uuid::Uuid; use crate::deserr::DeserrJsonError; -use crate::error::{deserr_codes::*, ParseOffsetDateTimeError}; -use crate::error::{unwrap_any, Code}; +use crate::error::deserr_codes::*; +use crate::error::{unwrap_any, Code, ParseOffsetDateTimeError}; use crate::index_uid::IndexUid; use crate::star_or::StarOr; diff --git a/meilisearch-types/src/lib.rs b/meilisearch-types/src/lib.rs index de4084388..14602b5aa 100644 --- a/meilisearch-types/src/lib.rs +++ b/meilisearch-types/src/lib.rs @@ -1,4 +1,5 @@ pub mod compression; +pub mod deserr; pub mod document_formats; pub mod error; pub mod index_uid; @@ -7,12 +8,10 @@ pub mod settings; pub mod star_or; pub mod tasks; pub mod versioning; -pub mod deserr; -pub use milli; pub use milli::{heed, Index}; -pub use serde_cs; use uuid::Uuid; pub use versioning::VERSION_FILE_NAME; +pub use {milli, serde_cs}; pub type Document = serde_json::Map; pub type InstanceUid = Uuid; diff --git a/meilisearch-types/src/settings.rs b/meilisearch-types/src/settings.rs index 8d085d0ff..57899a9d1 100644 --- a/meilisearch-types/src/settings.rs +++ b/meilisearch-types/src/settings.rs @@ -13,7 +13,7 @@ use serde::{Deserialize, Serialize, Serializer}; use crate::deserr::DeserrJsonError; use crate::error::deserr_codes::*; -use crate::error::{unwrap_any}; +use crate::error::unwrap_any; /// The maximimum number of results that the engine /// will be able to return in one search call. diff --git a/meilisearch-types/src/star_or.rs b/meilisearch-types/src/star_or.rs index e40884925..135f610c4 100644 --- a/meilisearch-types/src/star_or.rs +++ b/meilisearch-types/src/star_or.rs @@ -1,9 +1,13 @@ -use std::{fmt, marker::PhantomData, str::FromStr}; +use std::fmt; +use std::marker::PhantomData; +use std::str::FromStr; use deserr::{DeserializeError, DeserializeFromValue, MergeWithError, ValueKind}; -use serde::{de::Visitor, Deserialize, Deserializer, Serialize, Serializer}; +use serde::de::Visitor; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use crate::{deserr::query_params::FromQueryParameter, error::unwrap_any}; +use crate::deserr::query_params::FromQueryParameter; +use crate::error::unwrap_any; /// A type that tries to match either a star (*) or /// any other thing that implements `FromStr`. diff --git a/meilisearch/src/routes/indexes/mod.rs b/meilisearch/src/routes/indexes/mod.rs index 9e76f3be6..d19dc4773 100644 --- a/meilisearch/src/routes/indexes/mod.rs +++ b/meilisearch/src/routes/indexes/mod.rs @@ -7,8 +7,8 @@ use index_scheduler::IndexScheduler; use log::debug; use meilisearch_types::deserr::query_params::Param; use meilisearch_types::deserr::{DeserrJsonError, DeserrQueryParamError}; -use meilisearch_types::error::ResponseError; -use meilisearch_types::error::{deserr_codes::*, unwrap_any, Code}; +use meilisearch_types::error::deserr_codes::*; +use meilisearch_types::error::{unwrap_any, Code, ResponseError}; use meilisearch_types::index_uid::IndexUid; use meilisearch_types::milli::{self, FieldDistribution, Index}; use meilisearch_types::tasks::KindWithContent; diff --git a/meilisearch/src/routes/indexes/search.rs b/meilisearch/src/routes/indexes/search.rs index 7eabfc2ee..6bf5e3dae 100644 --- a/meilisearch/src/routes/indexes/search.rs +++ b/meilisearch/src/routes/indexes/search.rs @@ -3,8 +3,8 @@ use actix_web::{web, HttpRequest, HttpResponse}; use index_scheduler::IndexScheduler; use log::debug; use meilisearch_auth::IndexSearchRules; -use meilisearch_types::deserr::{DeserrQueryParamError, DeserrJsonError}; use meilisearch_types::deserr::query_params::Param; +use meilisearch_types::deserr::{DeserrJsonError, DeserrQueryParamError}; use meilisearch_types::error::deserr_codes::*; use meilisearch_types::error::ResponseError; use meilisearch_types::serde_cs::vec::CS; diff --git a/meilisearch/src/routes/tasks.rs b/meilisearch/src/routes/tasks.rs index 060c86910..17260cad4 100644 --- a/meilisearch/src/routes/tasks.rs +++ b/meilisearch/src/routes/tasks.rs @@ -4,8 +4,8 @@ use deserr::DeserializeFromValue; use index_scheduler::{IndexScheduler, Query, TaskId}; use meilisearch_types::deserr::query_params::Param; use meilisearch_types::deserr::DeserrQueryParamError; -use meilisearch_types::error::ResponseError; -use meilisearch_types::error::{deserr_codes::*, InvalidTaskDateError}; +use meilisearch_types::error::deserr_codes::*; +use meilisearch_types::error::{InvalidTaskDateError, ResponseError}; use meilisearch_types::index_uid::IndexUid; use meilisearch_types::settings::{Settings, Unchecked}; use meilisearch_types::star_or::{OptionStarOr, OptionStarOrList};