diff --git a/meilidb-core/src/query_builder.rs b/meilidb-core/src/query_builder.rs index 8aaa7d41a..4f7fe5766 100644 --- a/meilidb-core/src/query_builder.rs +++ b/meilidb-core/src/query_builder.rs @@ -353,7 +353,7 @@ mod tests { pub struct TempDatabase { database: Database, index: Index, - tempdir: TempDir, + _tempdir: TempDir, } impl TempDatabase { @@ -418,7 +418,7 @@ mod tests { writer.commit().unwrap(); drop(rkv); - TempDatabase { database, index, tempdir } + TempDatabase { database, index, _tempdir: tempdir } } } diff --git a/meilidb-core/src/store/documents_fields.rs b/meilidb-core/src/store/documents_fields.rs index 955a6af80..bc1033807 100644 --- a/meilidb-core/src/store/documents_fields.rs +++ b/meilidb-core/src/store/documents_fields.rs @@ -94,21 +94,20 @@ impl DocumentsFields { &self, reader: &'r T, document_id: DocumentId, - ) -> Result, rkv::StoreError> + ) -> Result, rkv::StoreError> { let document_id_bytes = document_id.0.to_be_bytes(); let iter = self.documents_fields.iter_from(reader, document_id_bytes)?; - Ok(DocumentFieldsIter { reader, document_id, iter }) + Ok(DocumentFieldsIter { document_id, iter }) } } -pub struct DocumentFieldsIter<'r, T> { - reader: &'r T, +pub struct DocumentFieldsIter<'r> { document_id: DocumentId, iter: rkv::store::single::Iter<'r>, } -impl<'r, T: rkv::Readable + 'r> Iterator for DocumentFieldsIter<'r, T> { +impl<'r> Iterator for DocumentFieldsIter<'r> { type Item = Result<(SchemaAttr, &'r [u8]), rkv::StoreError>; fn next(&mut self) -> Option { diff --git a/meilidb-core/src/update/documents_addition.rs b/meilidb-core/src/update/documents_addition.rs index 9bc2c8920..d0eb6a8b5 100644 --- a/meilidb-core/src/update/documents_addition.rs +++ b/meilidb-core/src/update/documents_addition.rs @@ -1,7 +1,6 @@ use std::collections::HashSet; use fst::{SetBuilder, set::OpBuilder}; -use meilidb_schema::Schema; use sdset::{SetOperation, duo::Union}; use serde::Serialize; @@ -76,7 +75,7 @@ pub fn push_documents_addition( let last_update_id = next_update_id(writer, updates_store, updates_results_store)?; let update = Update::DocumentsAddition(values); - let update_id = updates_store.put_update(writer, last_update_id, &update)?; + updates_store.put_update(writer, last_update_id, &update)?; Ok(last_update_id) } diff --git a/meilidb-core/src/update/documents_deletion.rs b/meilidb-core/src/update/documents_deletion.rs index d4e703aa8..c17452ea9 100644 --- a/meilidb-core/src/update/documents_deletion.rs +++ b/meilidb-core/src/update/documents_deletion.rs @@ -79,7 +79,7 @@ pub fn push_documents_deletion( let last_update_id = next_update_id(writer, updates_store, updates_results_store)?; let update = Update::DocumentsDeletion(deletion); - let update_id = updates_store.put_update(writer, last_update_id, &update)?; + updates_store.put_update(writer, last_update_id, &update)?; Ok(last_update_id) } diff --git a/meilidb-core/src/update/mod.rs b/meilidb-core/src/update/mod.rs index 0d2504115..0386ecc02 100644 --- a/meilidb-core/src/update/mod.rs +++ b/meilidb-core/src/update/mod.rs @@ -17,8 +17,7 @@ use std::cmp; use log::debug; use serde::{Serialize, Deserialize}; -use crate::{store, Error, MResult, DocumentId, RankedMap}; -use crate::error::UnsupportedOperation; +use crate::{store, MResult, DocumentId, RankedMap}; use meilidb_schema::Schema; #[derive(Debug, Serialize, Deserialize)] diff --git a/meilidb-core/src/update/schema_update.rs b/meilidb-core/src/update/schema_update.rs index d25bfa526..6c258c388 100644 --- a/meilidb-core/src/update/schema_update.rs +++ b/meilidb-core/src/update/schema_update.rs @@ -25,7 +25,7 @@ pub fn push_schema_update( let last_update_id = next_update_id(writer, updates_store, updates_results_store)?; let update = Update::SchemaUpdate(schema); - let update_id = updates_store.put_update(writer, last_update_id, &update)?; + updates_store.put_update(writer, last_update_id, &update)?; Ok(last_update_id) } diff --git a/meilidb-core/src/update/synonyms_addition.rs b/meilidb-core/src/update/synonyms_addition.rs index 69591b86e..7ed24a3d7 100644 --- a/meilidb-core/src/update/synonyms_addition.rs +++ b/meilidb-core/src/update/synonyms_addition.rs @@ -1,15 +1,11 @@ use std::collections::BTreeMap; -use std::sync::Arc; use fst::{SetBuilder, set::OpBuilder}; use sdset::SetBuf; use crate::automaton::normalize_str; -use crate::raw_indexer::RawIndexer; -use crate::serde::{extract_document_id, Serializer, RamDocumentStore}; -use crate::store; use crate::update::{Update, next_update_id}; -use crate::{MResult, Error, RankedMap}; +use crate::{store, MResult}; pub struct SynonymsAddition { updates_store: store::Updates, @@ -67,7 +63,7 @@ pub fn push_synonyms_addition( let last_update_id = next_update_id(writer, updates_store, updates_results_store)?; let update = Update::SynonymsAddition(addition); - let update_id = updates_store.put_update(writer, last_update_id, &update)?; + updates_store.put_update(writer, last_update_id, &update)?; Ok(last_update_id) } diff --git a/meilidb-core/src/update/synonyms_deletion.rs b/meilidb-core/src/update/synonyms_deletion.rs index 66ad1dd44..1acb553e1 100644 --- a/meilidb-core/src/update/synonyms_deletion.rs +++ b/meilidb-core/src/update/synonyms_deletion.rs @@ -1,16 +1,12 @@ use std::collections::BTreeMap; use std::iter::FromIterator; -use std::sync::Arc; use fst::{SetBuilder, set::OpBuilder}; use sdset::SetBuf; use crate::automaton::normalize_str; -use crate::raw_indexer::RawIndexer; -use crate::serde::{extract_document_id, Serializer, RamDocumentStore}; -use crate::store; use crate::update::{Update, next_update_id}; -use crate::{MResult, Error, RankedMap}; +use crate::{store, MResult}; pub struct SynonymsDeletion { updates_store: store::Updates, @@ -77,7 +73,7 @@ pub fn push_synonyms_deletion( let last_update_id = next_update_id(writer, updates_store, updates_results_store)?; let update = Update::SynonymsDeletion(deletion); - let update_id = updates_store.put_update(writer, last_update_id, &update)?; + updates_store.put_update(writer, last_update_id, &update)?; Ok(last_update_id) }