mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-24 05:36:28 +00:00
Prefer using the impl syntax
This commit is contained in:
@ -63,9 +63,9 @@ impl DocumentsFields {
|
||||
Ok(count)
|
||||
}
|
||||
|
||||
pub fn document_field<'a, T: rkv::Readable>(
|
||||
pub fn document_field<'a>(
|
||||
&self,
|
||||
reader: &'a T,
|
||||
reader: &'a impl rkv::Readable,
|
||||
document_id: DocumentId,
|
||||
attribute: SchemaAttr,
|
||||
) -> Result<Option<&'a [u8]>, rkv::StoreError>
|
||||
|
@ -26,9 +26,9 @@ impl Main {
|
||||
self.main.put(writer, WORDS_KEY, &blob)
|
||||
}
|
||||
|
||||
pub fn words_fst<T: rkv::Readable>(
|
||||
pub fn words_fst(
|
||||
&self,
|
||||
reader: &T,
|
||||
reader: &impl rkv::Readable,
|
||||
) -> MResult<Option<fst::Set>>
|
||||
{
|
||||
match self.main.get(reader, WORDS_KEY)? {
|
||||
@ -56,9 +56,9 @@ impl Main {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn ranked_map<T: rkv::Readable>(
|
||||
pub fn ranked_map(
|
||||
&self,
|
||||
reader: &T,
|
||||
reader: &impl rkv::Readable,
|
||||
) -> MResult<Option<RankedMap>>
|
||||
{
|
||||
match self.main.get(reader, RANKED_MAP_KEY)? {
|
||||
@ -82,9 +82,9 @@ impl Main {
|
||||
Ok(new)
|
||||
}
|
||||
|
||||
pub fn number_of_documents<T: rkv::Readable>(
|
||||
pub fn number_of_documents(
|
||||
&self,
|
||||
reader: &T,
|
||||
reader: &impl rkv::Readable,
|
||||
) -> Result<u64, rkv::StoreError>
|
||||
{
|
||||
match self.main.get(reader, NUMBER_OF_DOCUMENTS_KEY)? {
|
||||
|
@ -31,9 +31,9 @@ impl PostingsLists {
|
||||
self.postings_lists.delete(writer, word)
|
||||
}
|
||||
|
||||
pub fn postings_list<'a, T: rkv::Readable>(
|
||||
pub fn postings_list<'a>(
|
||||
&self,
|
||||
reader: &'a T,
|
||||
reader: &'a impl rkv::Readable,
|
||||
word: &[u8],
|
||||
) -> Result<Option<Cow<'a, sdset::Set<DocIndex>>>, rkv::StoreError>
|
||||
{
|
||||
|
@ -4,17 +4,17 @@ pub struct Synonyms {
|
||||
}
|
||||
|
||||
impl Synonyms {
|
||||
pub fn synonyms_fst<T: rkv::Readable>(
|
||||
pub fn synonyms_fst(
|
||||
&self,
|
||||
reader: &T,
|
||||
reader: &impl rkv::Readable,
|
||||
) -> Result<fst::Set, rkv::StoreError>
|
||||
{
|
||||
Ok(fst::Set::default())
|
||||
}
|
||||
|
||||
pub fn alternatives_to<T: rkv::Readable>(
|
||||
pub fn alternatives_to(
|
||||
&self,
|
||||
reader: &T,
|
||||
reader: &impl rkv::Readable,
|
||||
word: &[u8],
|
||||
) -> Result<Option<fst::Set>, rkv::StoreError>
|
||||
{
|
||||
|
@ -10,9 +10,9 @@ pub struct Updates {
|
||||
impl Updates {
|
||||
// TODO we should use the MDB_LAST op but
|
||||
// it is not exposed by the rkv library
|
||||
fn last_update_id<'a, T: rkv::Readable>(
|
||||
fn last_update_id<'a>(
|
||||
&self,
|
||||
reader: &'a T,
|
||||
reader: &'a impl rkv::Readable,
|
||||
) -> Result<Option<(u64, Option<Value<'a>>)>, rkv::StoreError>
|
||||
{
|
||||
let mut last = None;
|
||||
@ -33,9 +33,9 @@ impl Updates {
|
||||
Ok(Some((number, last_data)))
|
||||
}
|
||||
|
||||
pub fn contains<T: rkv::Readable>(
|
||||
pub fn contains(
|
||||
&self,
|
||||
reader: &T,
|
||||
reader: &impl rkv::Readable,
|
||||
update_id: u64,
|
||||
) -> Result<bool, rkv::StoreError>
|
||||
{
|
||||
|
@ -21,9 +21,9 @@ impl UpdatesResults {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn update_result<T: rkv::Readable>(
|
||||
pub fn update_result(
|
||||
&self,
|
||||
reader: &T,
|
||||
reader: &impl rkv::Readable,
|
||||
update_id: u64,
|
||||
) -> MResult<Option<UpdateResult>>
|
||||
{
|
||||
|
Reference in New Issue
Block a user