diff --git a/milli/src/fields_ids_map/global.rs b/milli/src/fields_ids_map/global.rs index 2b948b377..32aefbfdf 100644 --- a/milli/src/fields_ids_map/global.rs +++ b/milli/src/fields_ids_map/global.rs @@ -62,10 +62,6 @@ impl LocalFieldsIdsMap { fn metadata(&self, id: FieldId) -> Option { self.metadata.get(&id).copied() } - - fn iter(&self) -> impl Iterator { - self.ids_names.iter().map(|(k, v)| (*k, v.as_str(), self.metadata.get(k).copied().unwrap())) - } } impl<'indexing> GlobalFieldsIdsMap<'indexing> { diff --git a/milli/src/fields_ids_map/metadata.rs b/milli/src/fields_ids_map/metadata.rs index 8198bd415..54fdc7b4b 100644 --- a/milli/src/fields_ids_map/metadata.rs +++ b/milli/src/fields_ids_map/metadata.rs @@ -158,8 +158,7 @@ impl MetadataBuilder { let localized_attributes_rule_id = self .localized_attributes .iter() - .map(|v| v.iter()) - .flatten() + .flat_map(|v| v.iter()) .position(|rule| rule.match_str(field)) .map(|id| NonZeroU16::new(id.saturating_add(1).try_into().unwrap()).unwrap()); diff --git a/milli/src/prompt/document.rs b/milli/src/prompt/document.rs index d6aadce65..28c0f47af 100644 --- a/milli/src/prompt/document.rs +++ b/milli/src/prompt/document.rs @@ -520,7 +520,7 @@ impl<'doc> ValueView for ParseableValue<'doc> { Value::Null => ValueView::to_kstr(&LiquidValue::Nil), Value::Bool(v) => ValueView::to_kstr(v), Value::Number(_number) => self.render().to_string().into(), - Value::String(s) => KStringCow::from_ref(*s), + Value::String(s) => KStringCow::from_ref(s), Value::Array(raw_vec) => ParseableArray::as_parseable(raw_vec).to_kstr(), Value::Object(raw_map) => ParseableMap::as_parseable(raw_map).to_kstr(), } @@ -577,10 +577,7 @@ impl<'doc> ValueView for ParseableValue<'doc> { fn is_scalar(&self) -> bool { use raw_collections::Value; - match &self.value { - Value::Bool(_) | Value::Number(_) | Value::String(_) => true, - _ => false, - } + matches!(&self.value, Value::Bool(_) | Value::Number(_) | Value::String(_)) } fn as_array(&self) -> Option<&dyn liquid::model::ArrayView> { diff --git a/milli/src/prompt/fields.rs b/milli/src/prompt/fields.rs index b5d86b348..ab15c31b0 100644 --- a/milli/src/prompt/fields.rs +++ b/milli/src/prompt/fields.rs @@ -316,11 +316,3 @@ impl<'a, 'map, D: ObjectView> fmt::Display for ArrayRender<'a, 'map, D> { Ok(()) } } - -fn convert_index(index: i64, max_size: i64) -> i64 { - if 0 <= index { - index - } else { - max_size + index - } -} diff --git a/milli/src/prompt/mod.rs b/milli/src/prompt/mod.rs index fd843cd3c..bbcf054e6 100644 --- a/milli/src/prompt/mod.rs +++ b/milli/src/prompt/mod.rs @@ -128,7 +128,7 @@ impl Prompt { let context = Context::new(&document, &fields); let mut rendered = bumpalo::collections::Vec::with_capacity_in( self.max_bytes.unwrap_or_else(default_max_bytes).get(), - &doc_alloc, + doc_alloc, ); self.template .render_to(&mut rendered, &context)