makes clippy and fmt happy

This commit is contained in:
Tamo 2024-06-05 11:21:06 +02:00
parent d92c173fdc
commit 376b3a19a7
3 changed files with 6 additions and 5 deletions

View File

@ -1051,7 +1051,7 @@ fn make_hits(
formatter_builder.highlight_prefix(format.highlight_pre_tag);
formatter_builder.highlight_suffix(format.highlight_post_tag);
let mut documents = Vec::new();
let embedding_configs = index.embedding_configs(&rtxn)?;
let embedding_configs = index.embedding_configs(rtxn)?;
let documents_iter = index.documents(rtxn, documents_ids)?;
for ((id, obkv), score) in documents_iter.into_iter().zip(document_scores.into_iter()) {
// First generate a document with all the displayed fields
@ -1066,7 +1066,7 @@ fn make_hits(
if retrieve_vectors {
let mut vectors = serde_json::Map::new();
for (name, mut vector) in index.embeddings(&rtxn, id)? {
for (name, mut vector) in index.embeddings(rtxn, id)? {
let user_defined = embedding_configs
.iter()
.find(|conf| conf.name == name)
@ -1079,7 +1079,7 @@ fn make_hits(
} else {
embedding.insert("embedding".to_string(), vector.into());
}
vectors.insert(name.into(), embedding.into());
vectors.insert(name, embedding.into());
}
document.insert("_vectors".into(), vectors.into());
}

View File

@ -4,7 +4,8 @@ use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use crate::{vector::parsed_vectors::RESERVED_VECTORS_FIELD_NAME, FieldId, FieldsIdsMap, Weight};
use crate::vector::parsed_vectors::RESERVED_VECTORS_FIELD_NAME;
use crate::{FieldId, FieldsIdsMap, Weight};
#[derive(Debug, Default, Serialize, Deserialize)]
pub struct FieldidsWeightsMap {

View File

@ -656,7 +656,7 @@ pub(crate) fn write_typed_chunk_into_index(
// typed chunks has always at least 1 chunk.
let Some((expected_dimension, embedder_name)) = params else { unreachable!() };
let mut embedding_configs = index.embedding_configs(&wtxn)?;
let mut embedding_configs = index.embedding_configs(wtxn)?;
let index_embedder_config = embedding_configs
.iter_mut()
.find(|IndexEmbeddingConfig { name, .. }| name == &embedder_name)