diff --git a/meilisearch-http/src/index/search.rs b/meilisearch-http/src/index/search.rs index b2c606c02..56fa5425f 100644 --- a/meilisearch-http/src/index/search.rs +++ b/meilisearch-http/src/index/search.rs @@ -182,7 +182,7 @@ impl Index { highlight = f.highlight; } formatted_options.insert(id, FormatOptions { - highlight: highlight, + highlight, crop: attr_len, }); } @@ -195,7 +195,7 @@ impl Index { highlight = f.highlight; } formatted_options.insert(id, FormatOptions { - highlight: highlight, + highlight, crop: attr_len, }); } @@ -362,14 +362,14 @@ fn compute_formatted>( obkv: obkv::KvReader, formatter: &Formatter, matching_words: &impl Matcher, - ids_in_formatted: &Vec, + ids_in_formatted: &[FieldId], formatted_options: &HashMap, // to_highlight_fields: &HashSet, //ICI // to_crop_fields: &HashMap>, //ICI ) -> anyhow::Result { let mut document = Document::new(); - if formatted_options.len() > 0 { + if !formatted_options.is_empty() { for field in ids_in_formatted { if let Some(value) = obkv.get(*field) { let mut value: Value = serde_json::from_slice(value)?;