mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 14:54:27 +01:00
Fix clippy warnings
This commit is contained in:
parent
58d2aad309
commit
e6f03f82df
@ -30,7 +30,7 @@ pub fn setup_meilisearch(opt: &Opt) -> anyhow::Result<MeiliSearch> {
|
|||||||
let mut meilisearch = MeiliSearch::builder();
|
let mut meilisearch = MeiliSearch::builder();
|
||||||
|
|
||||||
// disable autobatching?
|
// disable autobatching?
|
||||||
let _ = AUTOBATCHING_ENABLED.store(
|
AUTOBATCHING_ENABLED.store(
|
||||||
opt.scheduler_options.disable_auto_batching,
|
opt.scheduler_options.disable_auto_batching,
|
||||||
std::sync::atomic::Ordering::Relaxed,
|
std::sync::atomic::Ordering::Relaxed,
|
||||||
);
|
);
|
||||||
|
@ -11,7 +11,7 @@ pub enum DumpError {
|
|||||||
#[error("An internal error has occurred. `{0}`.")]
|
#[error("An internal error has occurred. `{0}`.")]
|
||||||
Internal(Box<dyn std::error::Error + Send + Sync + 'static>),
|
Internal(Box<dyn std::error::Error + Send + Sync + 'static>),
|
||||||
#[error("{0}")]
|
#[error("{0}")]
|
||||||
IndexResolver(#[from] IndexResolverError),
|
IndexResolver(Box<IndexResolverError>),
|
||||||
}
|
}
|
||||||
|
|
||||||
internal_error!(
|
internal_error!(
|
||||||
@ -26,6 +26,12 @@ internal_error!(
|
|||||||
TaskError
|
TaskError
|
||||||
);
|
);
|
||||||
|
|
||||||
|
impl From<IndexResolverError> for DumpError {
|
||||||
|
fn from(e: IndexResolverError) -> Self {
|
||||||
|
Self::IndexResolver(Box::new(e))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl ErrorCode for DumpError {
|
impl ErrorCode for DumpError {
|
||||||
fn error_code(&self) -> Code {
|
fn error_code(&self) -> Code {
|
||||||
match self {
|
match self {
|
||||||
|
@ -484,7 +484,7 @@ fn make_batch(tasks: &mut TaskQueue, config: &SchedulerConfig) -> Processing {
|
|||||||
match list.peek() {
|
match list.peek() {
|
||||||
Some(pending) if pending.kind == kind => {
|
Some(pending) if pending.kind == kind => {
|
||||||
// We always need to process at least one task for the scheduler to make progress.
|
// We always need to process at least one task for the scheduler to make progress.
|
||||||
if config.disable_auto_batching && task_list.len() > 0 {
|
if config.disable_auto_batching && !task_list.is_empty() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
let pending = list.pop().unwrap();
|
let pending = list.pop().unwrap();
|
||||||
|
Loading…
Reference in New Issue
Block a user