mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-19 01:18:31 +08:00
get rids of the let/else syntax
This commit is contained in:
parent
746b31c1ce
commit
29d14bed90
@ -1060,9 +1060,17 @@ impl IndexScheduler {
|
|||||||
let (new_builder, user_result) = builder.add_documents(reader)?;
|
let (new_builder, user_result) = builder.add_documents(reader)?;
|
||||||
builder = new_builder;
|
builder = new_builder;
|
||||||
|
|
||||||
let Some(Details::DocumentAdditionOrUpdate { received_documents, .. }) = task.details
|
let received_documents =
|
||||||
// In the case of a `documentAdditionOrUpdate` the details MUST be set
|
if let Some(Details::DocumentAdditionOrUpdate {
|
||||||
else { unreachable!(); };
|
received_documents,
|
||||||
|
..
|
||||||
|
}) = task.details
|
||||||
|
{
|
||||||
|
received_documents
|
||||||
|
} else {
|
||||||
|
// In the case of a `documentAdditionOrUpdate` the details MUST be set
|
||||||
|
unreachable!();
|
||||||
|
};
|
||||||
|
|
||||||
match user_result {
|
match user_result {
|
||||||
Ok(count) => {
|
Ok(count) => {
|
||||||
@ -1087,9 +1095,15 @@ impl IndexScheduler {
|
|||||||
builder.remove_documents(document_ids)?;
|
builder.remove_documents(document_ids)?;
|
||||||
builder = new_builder;
|
builder = new_builder;
|
||||||
|
|
||||||
let Some(Details::DocumentDeletion { provided_ids, .. }) = task.details
|
let provided_ids =
|
||||||
// In the case of a `documentAdditionOrUpdate` the details MUST be set
|
if let Some(Details::DocumentDeletion { provided_ids, .. }) =
|
||||||
else { unreachable!(); };
|
task.details
|
||||||
|
{
|
||||||
|
provided_ids
|
||||||
|
} else {
|
||||||
|
// In the case of a `documentAdditionOrUpdate` the details MUST be set
|
||||||
|
unreachable!();
|
||||||
|
};
|
||||||
|
|
||||||
match user_result {
|
match user_result {
|
||||||
Ok(count) => {
|
Ok(count) => {
|
||||||
|
@ -440,10 +440,16 @@ impl IndexScheduler {
|
|||||||
deleted_documents,
|
deleted_documents,
|
||||||
} => {
|
} => {
|
||||||
assert_eq!(kind.as_kind(), Kind::DocumentDeletion);
|
assert_eq!(kind.as_kind(), Kind::DocumentDeletion);
|
||||||
let KindWithContent::DocumentDeletion {
|
let (index_uid, documents_ids) =
|
||||||
ref index_uid,
|
if let KindWithContent::DocumentDeletion {
|
||||||
ref documents_ids,
|
ref index_uid,
|
||||||
} = kind else { unreachable!() };
|
ref documents_ids,
|
||||||
|
} = kind
|
||||||
|
{
|
||||||
|
(index_uid, documents_ids)
|
||||||
|
} else {
|
||||||
|
unreachable!()
|
||||||
|
};
|
||||||
assert_eq!(&task_index_uid.unwrap(), index_uid);
|
assert_eq!(&task_index_uid.unwrap(), index_uid);
|
||||||
|
|
||||||
match status {
|
match status {
|
||||||
|
Loading…
Reference in New Issue
Block a user