fix test warnings

This commit is contained in:
mpostma 2020-05-27 19:32:55 +02:00
parent b859477ffd
commit 2b7d614e84
2 changed files with 9 additions and 9 deletions

View File

@ -325,7 +325,7 @@ fn search_command(command: SearchCommand, database: Database) -> Result<(), Box<
let reader = db.main_read_txn().unwrap();
let schema = index.main.schema(&reader)?;
reader.abort();
reader.abort().unwrap();
let schema = schema.ok_or(meilisearch_core::Error::SchemaMissing)?;
@ -454,7 +454,7 @@ fn show_updates_command(
let reader = db.update_read_txn().unwrap();
let updates = index.all_updates_status(&reader)?;
println!("{:#?}", updates);
reader.abort();
reader.abort().unwrap();
Ok(())
}

View File

@ -638,7 +638,7 @@ mod tests {
let update_reader = db.update_read_txn().unwrap();
let result = index.update_status(&update_reader, update_id).unwrap();
assert_matches!(result, Some(UpdateStatus::Processed { content }) if content.error.is_none());
update_reader.abort();
update_reader.abort().unwrap();
let mut additions = index.documents_addition();
@ -672,14 +672,14 @@ mod tests {
let update_reader = db.update_read_txn().unwrap();
let result = index.update_status(&update_reader, update_id).unwrap();
assert_matches!(result, Some(UpdateStatus::Processed { content }) if content.error.is_none());
update_reader.abort();
update_reader.abort().unwrap();
// even try to search for a document
let reader = db.main_read_txn().unwrap();
let SortResult {documents, .. } = index.query_builder().query(&reader, "21 ", 0..20).unwrap();
assert_matches!(documents.len(), 1);
reader.abort();
reader.abort().unwrap();
// try to introduce attributes in the middle of the schema
let settings = {
@ -768,7 +768,7 @@ mod tests {
let update_reader = db.update_read_txn().unwrap();
let result = index.update_status(&update_reader, update_id).unwrap();
assert_matches!(result, Some(UpdateStatus::Processed { content }) if content.error.is_none());
update_reader.abort();
update_reader.abort().unwrap();
let reader = db.main_read_txn().unwrap();
let document: Option<IgnoredAny> = index.document(&reader, None, DocumentId(25)).unwrap();
@ -848,7 +848,7 @@ mod tests {
let update_reader = db.update_read_txn().unwrap();
let result = index.update_status(&update_reader, update_id).unwrap();
assert_matches!(result, Some(UpdateStatus::Processed { content }) if content.error.is_none());
update_reader.abort();
update_reader.abort().unwrap();
let reader = db.main_read_txn().unwrap();
let document: Option<IgnoredAny> = index.document(&reader, None, DocumentId(25)).unwrap();
@ -864,7 +864,7 @@ mod tests {
.unwrap();
assert!(document.is_some());
reader.abort();
reader.abort().unwrap();
let mut partial_additions = index.documents_partial_addition();
@ -893,7 +893,7 @@ mod tests {
let update_reader = db.update_read_txn().unwrap();
let result = index.update_status(&update_reader, update_id).unwrap();
assert_matches!(result, Some(UpdateStatus::Processed { content }) if content.error.is_none());
update_reader.abort();
update_reader.abort().unwrap();
let reader = db.main_read_txn().unwrap();
let document: Option<serde_json::Value> = index