apply most style comments of the review

This commit is contained in:
Tamo 2022-10-17 16:45:00 +02:00 committed by Clément Renault
parent dd70daaae3
commit 78ce29f461
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
7 changed files with 27 additions and 23 deletions

View file

@ -79,7 +79,7 @@ pub fn setup_meilisearch(opt: &Opt) -> anyhow::Result<(IndexScheduler, AuthContr
todo!("We'll see later"),
)
};
let meilisearch = || -> anyhow::Result<_> {
let meilisearch_builder = || -> anyhow::Result<_> {
// if anything wrong happens we delete the `data.ms` entirely.
match (
index_scheduler_builder().map_err(anyhow::Error::from),
@ -102,7 +102,7 @@ pub fn setup_meilisearch(opt: &Opt) -> anyhow::Result<(IndexScheduler, AuthContr
let src_path_exists = path.exists();
if empty_db && src_path_exists {
let (mut index_scheduler, mut auth_controller) = meilisearch()?;
let (mut index_scheduler, mut auth_controller) = meilisearch_builder()?;
import_dump(
&opt.db_path,
path,
@ -120,7 +120,7 @@ pub fn setup_meilisearch(opt: &Opt) -> anyhow::Result<(IndexScheduler, AuthContr
} else if !src_path_exists && !opt.ignore_missing_dump {
bail!("dump doesn't exist at {:?}", path)
} else {
let (mut index_scheduler, mut auth_controller) = meilisearch()?;
let (mut index_scheduler, mut auth_controller) = meilisearch_builder()?;
import_dump(
&opt.db_path,
path,
@ -130,7 +130,7 @@ pub fn setup_meilisearch(opt: &Opt) -> anyhow::Result<(IndexScheduler, AuthContr
(index_scheduler, auth_controller)
}
} else {
meilisearch()?
meilisearch_builder()?
};
/*
@ -260,7 +260,7 @@ fn import_dump(
// 4. Import the tasks.
for ret in dump_reader.tasks() {
let (task, file) = ret?;
index_scheduler.register_dumpped_task(task, file, &keys, instance_uid)?;
index_scheduler.register_dumped_task(task, file, &keys, instance_uid)?;
}
Ok(())
}