mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
clippy + fmt
This commit is contained in:
parent
b000ae7614
commit
834995b130
13 changed files with 78 additions and 53 deletions
|
@ -24,8 +24,8 @@ use uuid_resolver::{error::UuidResolverError, UuidResolverHandle};
|
|||
|
||||
use crate::index::{Checked, Document, SearchQuery, SearchResult, Settings};
|
||||
use crate::option::Opt;
|
||||
use error::Result;
|
||||
use crate::Payload;
|
||||
use error::Result;
|
||||
|
||||
use self::dump_actor::load_dump;
|
||||
use self::error::IndexControllerError;
|
||||
|
|
|
@ -137,7 +137,10 @@ where
|
|||
.open(&path)
|
||||
.await?;
|
||||
|
||||
async fn write_to_file<D>(file: &mut fs::File, mut payload: mpsc::Receiver<PayloadData<D>>) -> Result<usize>
|
||||
async fn write_to_file<D>(
|
||||
file: &mut fs::File,
|
||||
mut payload: mpsc::Receiver<PayloadData<D>>,
|
||||
) -> Result<usize>
|
||||
where
|
||||
D: AsRef<[u8]> + Sized + 'static,
|
||||
{
|
||||
|
@ -160,7 +163,7 @@ where
|
|||
}
|
||||
Err(e) => {
|
||||
fs::remove_file(&path).await?;
|
||||
return Err(e)
|
||||
return Err(e);
|
||||
}
|
||||
_ => {
|
||||
fs::remove_file(&path).await?;
|
||||
|
|
|
@ -52,11 +52,9 @@ impl ErrorCode for UpdateActorError {
|
|||
UpdateActorError::IndexActor(e) => e.error_code(),
|
||||
UpdateActorError::FatalUpdateStoreError => Code::Internal,
|
||||
UpdateActorError::InvalidPayload(_) => Code::BadRequest,
|
||||
UpdateActorError::PayloadError(error) => {
|
||||
match error {
|
||||
actix_http::error::PayloadError::Overflow => Code::PayloadTooLarge,
|
||||
_ => Code::Internal,
|
||||
}
|
||||
UpdateActorError::PayloadError(error) => match error {
|
||||
actix_http::error::PayloadError::Overflow => Code::PayloadTooLarge,
|
||||
_ => Code::Internal,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -572,7 +572,10 @@ fn update_uuid_to_file_path(root: impl AsRef<Path>, uuid: Uuid) -> PathBuf {
|
|||
#[cfg(test)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use crate::index_controller::{UpdateResult, index_actor::{MockIndexActorHandle, error::IndexActorError}};
|
||||
use crate::index_controller::{
|
||||
index_actor::{error::IndexActorError, MockIndexActorHandle},
|
||||
UpdateResult,
|
||||
};
|
||||
|
||||
use futures::future::ok;
|
||||
|
||||
|
@ -651,7 +654,9 @@ mod test {
|
|||
if processing.id() == 0 {
|
||||
Box::pin(ok(Ok(processing.process(UpdateResult::Other))))
|
||||
} else {
|
||||
Box::pin(ok(Err(processing.fail(IndexActorError::ExistingPrimaryKey.into()))))
|
||||
Box::pin(ok(Err(
|
||||
processing.fail(IndexActorError::ExistingPrimaryKey.into())
|
||||
)))
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -3,7 +3,10 @@ use milli::update::{DocumentAdditionResult, IndexDocumentsMethod, UpdateFormat};
|
|||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
use crate::{error::ResponseError, index::{Settings, Unchecked}};
|
||||
use crate::{
|
||||
error::ResponseError,
|
||||
index::{Settings, Unchecked},
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub enum UpdateResult {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue