mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
get rids of the let/else syntax
This commit is contained in:
parent
746b31c1ce
commit
29d14bed90
2 changed files with 30 additions and 10 deletions
|
@ -1060,9 +1060,17 @@ impl IndexScheduler {
|
|||
let (new_builder, user_result) = builder.add_documents(reader)?;
|
||||
builder = new_builder;
|
||||
|
||||
let Some(Details::DocumentAdditionOrUpdate { received_documents, .. }) = task.details
|
||||
// In the case of a `documentAdditionOrUpdate` the details MUST be set
|
||||
else { unreachable!(); };
|
||||
let received_documents =
|
||||
if let Some(Details::DocumentAdditionOrUpdate {
|
||||
received_documents,
|
||||
..
|
||||
}) = task.details
|
||||
{
|
||||
received_documents
|
||||
} else {
|
||||
// In the case of a `documentAdditionOrUpdate` the details MUST be set
|
||||
unreachable!();
|
||||
};
|
||||
|
||||
match user_result {
|
||||
Ok(count) => {
|
||||
|
@ -1087,9 +1095,15 @@ impl IndexScheduler {
|
|||
builder.remove_documents(document_ids)?;
|
||||
builder = new_builder;
|
||||
|
||||
let Some(Details::DocumentDeletion { provided_ids, .. }) = task.details
|
||||
// In the case of a `documentAdditionOrUpdate` the details MUST be set
|
||||
else { unreachable!(); };
|
||||
let provided_ids =
|
||||
if let Some(Details::DocumentDeletion { provided_ids, .. }) =
|
||||
task.details
|
||||
{
|
||||
provided_ids
|
||||
} else {
|
||||
// In the case of a `documentAdditionOrUpdate` the details MUST be set
|
||||
unreachable!();
|
||||
};
|
||||
|
||||
match user_result {
|
||||
Ok(count) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue