fmt
This commit is contained in:
parent
abdf642d68
commit
fa573dabf0
|
@ -177,7 +177,7 @@ impl ErrorCode for MilliError<'_> {
|
|||
UserError::PrimaryKeyCannotBeReset => Code::PrimaryKeyAlreadyPresent,
|
||||
UserError::UnknownInternalDocumentId { .. } => Code::DocumentNotFound,
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,8 +20,7 @@ pub enum IndexError {
|
|||
}
|
||||
|
||||
internal_error!(
|
||||
IndexError:
|
||||
std::io::Error,
|
||||
IndexError: std::io::Error,
|
||||
heed::Error,
|
||||
fst::Error,
|
||||
serde_json::Error
|
||||
|
|
|
@ -190,9 +190,7 @@ impl Index {
|
|||
if fields.iter().all(|f| f != "*") {
|
||||
facet_distribution.facets(fields);
|
||||
}
|
||||
let distribution = facet_distribution
|
||||
.candidates(candidates)
|
||||
.execute()?;
|
||||
let distribution = facet_distribution.candidates(candidates).execute()?;
|
||||
|
||||
Some(distribution)
|
||||
}
|
||||
|
@ -532,7 +530,7 @@ fn parse_filter(facets: &Value, index: &Index, txn: &RoTxn) -> Result<Option<Fil
|
|||
Ok(Some(condition))
|
||||
}
|
||||
Value::Array(arr) => parse_filter_array(txn, index, arr),
|
||||
v => return Err(FacetError::InvalidExpression(&["Array"], v.clone()).into()),
|
||||
v => Err(FacetError::InvalidExpression(&["Array"], v.clone()).into()),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -219,7 +219,9 @@ impl Index {
|
|||
|
||||
let gzipped = false;
|
||||
let addition = match content {
|
||||
Some(content) if gzipped => builder.execute(GzDecoder::new(content), indexing_callback)?,
|
||||
Some(content) if gzipped => {
|
||||
builder.execute(GzDecoder::new(content), indexing_callback)?
|
||||
}
|
||||
Some(content) => builder.execute(content, indexing_callback)?,
|
||||
None => builder.execute(std::io::empty(), indexing_callback)?,
|
||||
};
|
||||
|
@ -297,7 +299,9 @@ impl Index {
|
|||
}
|
||||
}
|
||||
|
||||
builder.execute(|indexing_step, update_id| info!("update {}: {:?}", update_id, indexing_step))?;
|
||||
builder.execute(|indexing_step, update_id| {
|
||||
info!("update {}: {:?}", update_id, indexing_step)
|
||||
})?;
|
||||
|
||||
Ok(UpdateResult::Other)
|
||||
}
|
||||
|
|
|
@ -141,9 +141,11 @@ mod test {
|
|||
use super::*;
|
||||
use crate::index_controller::index_actor::MockIndexActorHandle;
|
||||
use crate::index_controller::update_actor::{
|
||||
MockUpdateActorHandle, UpdateActorHandleImpl, error::UpdateActorError,
|
||||
error::UpdateActorError, MockUpdateActorHandle, UpdateActorHandleImpl,
|
||||
};
|
||||
use crate::index_controller::uuid_resolver::{
|
||||
error::UuidResolverError, MockUuidResolverHandle,
|
||||
};
|
||||
use crate::index_controller::uuid_resolver::{MockUuidResolverHandle, error::UuidResolverError};
|
||||
|
||||
#[actix_rt::test]
|
||||
async fn test_normal() {
|
||||
|
|
|
@ -7,6 +7,7 @@ use crate::index_controller::index_actor::error::IndexActorError;
|
|||
pub type Result<T> = std::result::Result<T, UpdateActorError>;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub enum UpdateActorError {
|
||||
#[error("Update {0} doesn't exist.")]
|
||||
UnexistingUpdate(u64),
|
||||
|
@ -33,8 +34,7 @@ impl From<tokio::sync::oneshot::error::RecvError> for UpdateActorError {
|
|||
}
|
||||
|
||||
internal_error!(
|
||||
UpdateActorError:
|
||||
heed::Error,
|
||||
UpdateActorError: heed::Error,
|
||||
std::io::Error,
|
||||
serde_json::Error,
|
||||
actix_http::error::PayloadError,
|
||||
|
|
|
@ -4,7 +4,7 @@ use log::{info, warn};
|
|||
use tokio::sync::mpsc;
|
||||
use uuid::Uuid;
|
||||
|
||||
use super::{Result, UuidResolveMsg, error::UuidResolverError, UuidStore};
|
||||
use super::{error::UuidResolverError, Result, UuidResolveMsg, UuidStore};
|
||||
|
||||
pub struct UuidResolverActor<S> {
|
||||
inbox: mpsc::Receiver<UuidResolveMsg>,
|
||||
|
|
|
@ -10,9 +10,9 @@ use std::path::PathBuf;
|
|||
use uuid::Uuid;
|
||||
|
||||
use actor::UuidResolverActor;
|
||||
use error::Result;
|
||||
use message::UuidResolveMsg;
|
||||
use store::UuidStore;
|
||||
use error::Result;
|
||||
|
||||
#[cfg(test)]
|
||||
use mockall::automock;
|
||||
|
@ -22,7 +22,6 @@ pub use store::HeedUuidStore;
|
|||
|
||||
const UUID_STORE_SIZE: usize = 1_073_741_824; //1GiB
|
||||
|
||||
|
||||
#[async_trait::async_trait]
|
||||
#[cfg_attr(test, automock)]
|
||||
pub trait UuidResolverHandle {
|
||||
|
|
|
@ -8,7 +8,7 @@ use heed::{CompactionOption, Database, Env, EnvOpenOptions};
|
|||
use serde::{Deserialize, Serialize};
|
||||
use uuid::Uuid;
|
||||
|
||||
use super::{Result, error::UuidResolverError, UUID_STORE_SIZE};
|
||||
use super::{error::UuidResolverError, Result, UUID_STORE_SIZE};
|
||||
use crate::helpers::EnvSizer;
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
|
|
|
@ -60,7 +60,6 @@ async fn stats() {
|
|||
|
||||
index.wait_update_id(0).await;
|
||||
|
||||
|
||||
let (response, code) = server.stats().await;
|
||||
|
||||
assert_eq!(code, 200);
|
||||
|
|
Loading…
Reference in New Issue