Merge pull request #725 from MarinPostma/fix-test-warnings

fix test warnings
This commit is contained in:
Clément Renault 2020-05-28 11:49:42 +02:00 committed by GitHub
commit f1ac76a283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 reader = db.main_read_txn().unwrap();
let schema = index.main.schema(&reader)?; let schema = index.main.schema(&reader)?;
reader.abort(); reader.abort().unwrap();
let schema = schema.ok_or(meilisearch_core::Error::SchemaMissing)?; 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 reader = db.update_read_txn().unwrap();
let updates = index.all_updates_status(&reader)?; let updates = index.all_updates_status(&reader)?;
println!("{:#?}", updates); println!("{:#?}", updates);
reader.abort(); reader.abort().unwrap();
Ok(()) Ok(())
} }

View File

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