From 41eeffd88db79eeb83907069c2c942a1c418e0b0 Mon Sep 17 00:00:00 2001 From: Tamo Date: Tue, 21 Jan 2025 16:41:16 +0100 Subject: [PATCH] fmt --- .../index-scheduler/src/scheduler/process_upgrade/mod.rs | 9 ++++----- crates/index-scheduler/src/scheduler/test_failure.rs | 3 +-- crates/index-scheduler/src/upgrade/mod.rs | 8 +++----- crates/meilisearch/tests/upgrade/mod.rs | 6 +++--- crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs | 8 +++----- crates/milli/src/heed_codec/version.rs | 4 ++-- crates/milli/src/update/upgrade/v1_12.rs | 5 ++--- 7 files changed, 18 insertions(+), 25 deletions(-) diff --git a/crates/index-scheduler/src/scheduler/process_upgrade/mod.rs b/crates/index-scheduler/src/scheduler/process_upgrade/mod.rs index 8472f2dba..319b7b594 100644 --- a/crates/index-scheduler/src/scheduler/process_upgrade/mod.rs +++ b/crates/index-scheduler/src/scheduler/process_upgrade/mod.rs @@ -1,9 +1,8 @@ -use meilisearch_types::{ - milli, - milli::progress::{Progress, VariableNameStep}, -}; +use meilisearch_types::milli; +use meilisearch_types::milli::progress::{Progress, VariableNameStep}; -use crate::{processing::UpgradeDatabaseProgress, Error, IndexScheduler, Result}; +use crate::processing::UpgradeDatabaseProgress; +use crate::{Error, IndexScheduler, Result}; impl IndexScheduler { pub(super) fn process_upgrade(&self, progress: Progress) -> Result<()> { diff --git a/crates/index-scheduler/src/scheduler/test_failure.rs b/crates/index-scheduler/src/scheduler/test_failure.rs index b215083fa..8e0c06331 100644 --- a/crates/index-scheduler/src/scheduler/test_failure.rs +++ b/crates/index-scheduler/src/scheduler/test_failure.rs @@ -10,9 +10,8 @@ use meilisearch_types::tasks::KindWithContent; use roaring::RoaringBitmap; use crate::insta_snapshot::snapshot_index_scheduler; -use crate::test_utils::Breakpoint; use crate::test_utils::Breakpoint::*; -use crate::test_utils::{index_creation_task, read_json, FailureLocation}; +use crate::test_utils::{index_creation_task, read_json, Breakpoint, FailureLocation}; use crate::IndexScheduler; #[test] diff --git a/crates/index-scheduler/src/upgrade/mod.rs b/crates/index-scheduler/src/upgrade/mod.rs index ec63d0dc6..981dc8eb8 100644 --- a/crates/index-scheduler/src/upgrade/mod.rs +++ b/crates/index-scheduler/src/upgrade/mod.rs @@ -1,11 +1,9 @@ use std::path::Path; use anyhow::bail; -use meilisearch_types::{ - heed, - tasks::{KindWithContent, Status, Task}, - versioning::{VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH}, -}; +use meilisearch_types::heed; +use meilisearch_types::tasks::{KindWithContent, Status, Task}; +use meilisearch_types::versioning::{VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH}; use time::OffsetDateTime; use tracing::info; diff --git a/crates/meilisearch/tests/upgrade/mod.rs b/crates/meilisearch/tests/upgrade/mod.rs index 6feacf982..daa345169 100644 --- a/crates/meilisearch/tests/upgrade/mod.rs +++ b/crates/meilisearch/tests/upgrade/mod.rs @@ -1,13 +1,13 @@ mod v1_12; +use std::path::Path; +use std::{fs, io}; + use meili_snap::snapshot; use meilisearch::Opt; use crate::common::{default_settings, Server}; -use std::path::Path; -use std::{fs, io}; - fn copy_dir_all(src: impl AsRef, dst: impl AsRef) -> io::Result<()> { fs::create_dir_all(&dst)?; for entry in fs::read_dir(src)? { diff --git a/crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs b/crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs index fd2d363f2..07cf376c1 100644 --- a/crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs +++ b/crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs @@ -6,11 +6,9 @@ use manifest_dir_macros::exist_relative_path; use meili_snap::{json_string, snapshot}; use meilisearch::Opt; -use crate::{ - common::{default_settings, Server, Value}, - json, - upgrade::copy_dir_all, -}; +use crate::common::{default_settings, Server, Value}; +use crate::json; +use crate::upgrade::copy_dir_all; #[actix_rt::test] async fn import_v1_12_0() { diff --git a/crates/milli/src/heed_codec/version.rs b/crates/milli/src/heed_codec/version.rs index ce9724889..c73b581e3 100644 --- a/crates/milli/src/heed_codec/version.rs +++ b/crates/milli/src/heed_codec/version.rs @@ -1,5 +1,5 @@ -use std::mem::size_of; -use std::{borrow::Cow, mem::size_of_val}; +use std::borrow::Cow; +use std::mem::{size_of, size_of_val}; use byteorder::{BigEndian, ByteOrder}; use heed::{BoxedError, BytesDecode, BytesEncode}; diff --git a/crates/milli/src/update/upgrade/v1_12.rs b/crates/milli/src/update/upgrade/v1_12.rs index 4f76752d1..082896610 100644 --- a/crates/milli/src/update/upgrade/v1_12.rs +++ b/crates/milli/src/update/upgrade/v1_12.rs @@ -1,8 +1,7 @@ use heed::RwTxn; -use crate::{make_enum_progress, Result}; - -use crate::{progress::Progress, Index}; +use crate::progress::Progress; +use crate::{make_enum_progress, Index, Result}; // The field distribution was not computed correctly in the v1.12 until the v1.12.3 pub(super) fn v1_12_to_v1_12_3(