From 2b7d614e847074ef269734518f74d49b417ce3c2 Mon Sep 17 00:00:00 2001 From: mpostma Date: Wed, 27 May 2020 19:32:55 +0200 Subject: [PATCH] fix test warnings --- meilisearch-core/examples/from_file.rs | 4 ++-- meilisearch-core/src/database.rs | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/meilisearch-core/examples/from_file.rs b/meilisearch-core/examples/from_file.rs index ad319442e..821f23fcc 100644 --- a/meilisearch-core/examples/from_file.rs +++ b/meilisearch-core/examples/from_file.rs @@ -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(()) } diff --git a/meilisearch-core/src/database.rs b/meilisearch-core/src/database.rs index ffd3b7cb3..a26324930 100644 --- a/meilisearch-core/src/database.rs +++ b/meilisearch-core/src/database.rs @@ -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 = 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 = 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 = index