Clean up many warning messages

This commit is contained in:
Clément Renault 2019-10-08 17:31:07 +02:00
parent 0a5ad4db06
commit 6534a9ec1d
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
8 changed files with 14 additions and 25 deletions

View File

@ -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 }
}
}

View File

@ -94,21 +94,20 @@ impl DocumentsFields {
&self,
reader: &'r T,
document_id: DocumentId,
) -> Result<DocumentFieldsIter<'r, T>, rkv::StoreError>
) -> Result<DocumentFieldsIter<'r>, 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<Self::Item> {

View File

@ -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<D: serde::Serialize>(
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)
}

View File

@ -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)
}

View File

@ -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)]

View File

@ -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)
}

View File

@ -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)
}

View File

@ -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)
}