mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
remove the intermediate addition variable
This commit is contained in:
parent
b774adfbf7
commit
f117c90c46
@ -331,13 +331,10 @@ impl Index {
|
|||||||
builder = new_builder;
|
builder = new_builder;
|
||||||
|
|
||||||
let user_result = match user_result {
|
let user_result = match user_result {
|
||||||
Ok(count) => {
|
Ok(count) => Ok(DocumentAdditionResult {
|
||||||
let addition = DocumentAdditionResult {
|
indexed_documents: count,
|
||||||
indexed_documents: count,
|
number_of_documents: count,
|
||||||
number_of_documents: count,
|
}),
|
||||||
};
|
|
||||||
Ok(addition)
|
|
||||||
}
|
|
||||||
Err(e) => Err(IndexError::from(e)),
|
Err(e) => Err(IndexError::from(e)),
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -345,9 +342,9 @@ impl Index {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if results.iter().any(Result::is_ok) {
|
if results.iter().any(Result::is_ok) {
|
||||||
let _addition = builder.execute()?;
|
let addition = builder.execute()?;
|
||||||
txn.commit()?;
|
txn.commit()?;
|
||||||
info!("document addition done: {:?}", _addition);
|
info!("document addition done: {:?}", addition);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(results)
|
Ok(results)
|
||||||
|
Loading…
Reference in New Issue
Block a user