diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index 7353657f2..edbf2cae0 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -614,7 +614,7 @@ impl IndexScheduler { fs::create_dir_all(&dst)?; // TODO We can't use the open_auth_store_env function here but we should let auth = milli::heed::EnvOpenOptions::new() - .map_size(1 * 1024 * 1024 * 1024) // 1 GiB + .map_size(1024 * 1024 * 1024) // 1 GiB .max_dbs(2) .open(&self.auth_path)?; auth.copy_to_path(dst.join("data.mdb"), CompactionOption::Enabled)?; diff --git a/index-scheduler/src/lib.rs b/index-scheduler/src/lib.rs index 085fbf438..4b59a6bb7 100644 --- a/index-scheduler/src/lib.rs +++ b/index-scheduler/src/lib.rs @@ -2643,7 +2643,7 @@ mod tests { }}"#, i, i ); - let allow_index_creation = if i % 2 == 0 { false } else { true }; + let allow_index_creation = i % 2 != 0; let (uuid, mut file) = index_scheduler.create_update_file_with_uuid(i).unwrap(); let documents_count = meilisearch_types::document_formats::read_json( @@ -2703,7 +2703,7 @@ mod tests { }}"#, i, i ); - let allow_index_creation = if i % 2 == 0 { false } else { true }; + let allow_index_creation = i % 2 != 0; let (uuid, mut file) = index_scheduler.create_update_file_with_uuid(i).unwrap(); let documents_count = meilisearch_types::document_formats::read_json( diff --git a/meilisearch-http/src/routes/swap_indexes.rs b/meilisearch-http/src/routes/swap_indexes.rs index d0e73569a..6498e4692 100644 --- a/meilisearch-http/src/routes/swap_indexes.rs +++ b/meilisearch-http/src/routes/swap_indexes.rs @@ -40,20 +40,20 @@ pub async fn swap_indexes( return Err(MeilisearchHttpError::SwapIndexPayloadWrongLength(indexes).into()); } }; - if !search_rules.is_index_authorized(&lhs) { + if !search_rules.is_index_authorized(lhs) { unauthorized_indexes.insert(lhs.clone()); } - if !search_rules.is_index_authorized(&rhs) { + if !search_rules.is_index_authorized(rhs) { unauthorized_indexes.insert(rhs.clone()); } - match index_scheduler.index(&lhs) { + match index_scheduler.index(lhs) { Ok(_) => (), Err(index_scheduler::Error::IndexNotFound(_)) => { unknown_indexes.insert(lhs.clone()); } Err(e) => return Err(e.into()), } - match index_scheduler.index(&rhs) { + match index_scheduler.index(rhs) { Ok(_) => (), Err(index_scheduler::Error::IndexNotFound(_)) => { unknown_indexes.insert(rhs.clone()); diff --git a/meilisearch-http/src/routes/tasks.rs b/meilisearch-http/src/routes/tasks.rs index 41a499c20..d4eb1607d 100644 --- a/meilisearch-http/src/routes/tasks.rs +++ b/meilisearch-http/src/routes/tasks.rs @@ -32,7 +32,7 @@ pub fn configure(cfg: &mut web::ServiceConfig) { .service(web::resource("/{task_id}").route(web::get().to(SeqHandler(get_task)))); } -#[derive(Debug, Clone, PartialEq, Serialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] #[serde(rename_all = "camelCase")] pub struct TaskView { pub uid: TaskId, @@ -78,7 +78,7 @@ impl TaskView { } } -#[derive(Default, Debug, PartialEq, Clone, Serialize)] +#[derive(Default, Debug, PartialEq, Eq, Clone, Serialize)] #[serde(rename_all = "camelCase")] pub struct DetailsView { #[serde(skip_serializing_if = "Option::is_none")] diff --git a/meilisearch-types/src/settings.rs b/meilisearch-types/src/settings.rs index 6d53553a8..3369cfdfb 100644 --- a/meilisearch-types/src/settings.rs +++ b/meilisearch-types/src/settings.rs @@ -34,7 +34,7 @@ pub struct Checked; pub struct Unchecked; #[cfg_attr(test, derive(proptest_derive::Arbitrary))] -#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)] #[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct MinWordSizeTyposSetting { @@ -47,7 +47,7 @@ pub struct MinWordSizeTyposSetting { } #[cfg_attr(test, derive(proptest_derive::Arbitrary))] -#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)] #[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct TypoSettings { @@ -66,7 +66,7 @@ pub struct TypoSettings { } #[cfg_attr(test, derive(proptest_derive::Arbitrary))] -#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)] #[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct FacetingSettings { @@ -76,7 +76,7 @@ pub struct FacetingSettings { } #[cfg_attr(test, derive(proptest_derive::Arbitrary))] -#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)] #[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] pub struct PaginationSettings { @@ -88,7 +88,7 @@ pub struct PaginationSettings { /// Holds all the settings for an index. `T` can either be `Checked` if they represents settings /// whose validity is guaranteed, or `Unchecked` if they need to be validated. In the later case, a /// call to `check` will return a `Settings` from a `Settings`. -#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)] +#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq, Eq)] #[serde(deny_unknown_fields)] #[serde(rename_all = "camelCase")] #[serde(bound(serialize = "T: Serialize", deserialize = "T: Deserialize<'static>"))] diff --git a/meilisearch-types/src/tasks.rs b/meilisearch-types/src/tasks.rs index 6fbb1bd09..a5c990a2f 100644 --- a/meilisearch-types/src/tasks.rs +++ b/meilisearch-types/src/tasks.rs @@ -134,7 +134,7 @@ pub enum KindWithContent { SnapshotCreation, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct IndexSwap { pub indexes: (String, String), @@ -427,7 +427,7 @@ impl FromStr for Kind { } } -#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] pub enum Details { DocumentAdditionOrUpdate { received_documents: u64, indexed_documents: Option }, SettingsUpdate { settings: Box> },