diff --git a/meilisearch-types/src/keys.rs b/meilisearch-types/src/keys.rs index 13ca0ab10..140b1ab36 100644 --- a/meilisearch-types/src/keys.rs +++ b/meilisearch-types/src/keys.rs @@ -259,18 +259,18 @@ impl Action { ("experimental.update", Self::ExperimentalFeaturesUpdate), ]; - fn ser_action_to_action(v: &str) -> Option { + fn get_action(v: &str) -> Option { Self::SERDE_MAP_ARR .iter() - .find(|(ser_action, _)| &v == ser_action) + .find(|(serde_name, _)| &v == serde_name) .map(|(_, action)| *action) } - fn action_to_ser_action(v: &Action) -> &'static str { + fn get_action_serde_name(v: &Action) -> &'static str { Self::SERDE_MAP_ARR .iter() - .find(|(_, ref action)| v == action) - .map(|(ser_action, _)| ser_action) + .find(|(_, action)| v == action) + .map(|(serde_name, _)| serde_name) // actions should always have matching serialized values .unwrap() } @@ -326,7 +326,7 @@ impl Deserr for Action { location: deserr::ValuePointerRef<'_>, ) -> Result { match value { - deserr::Value::String(s) => match Self::ser_action_to_action(&s) { + deserr::Value::String(s) => match Self::get_action(&s) { Some(action) => Ok(action), None => Err(deserr::take_cf_content(E::error::( None, @@ -354,7 +354,7 @@ impl Serialize for Action { where S: Serializer, { - serializer.serialize_str(Self::action_to_ser_action(self)) + serializer.serialize_str(Self::get_action_serde_name(self)) } } @@ -375,7 +375,7 @@ impl<'de> Deserialize<'de> for Action { where E: serde::de::Error, { - match Self::Value::ser_action_to_action(s) { + match Self::Value::get_action(s) { Some(action) => Ok(action), None => Err(E::invalid_value(serde::de::Unexpected::Str(s), &"a valid action")), } diff --git a/milli/src/vector/mod.rs b/milli/src/vector/mod.rs index 349a59222..caccb404b 100644 --- a/milli/src/vector/mod.rs +++ b/milli/src/vector/mod.rs @@ -352,7 +352,7 @@ where None, deserr::ErrorKind::Unexpected { msg: format!( - "the distribution sigma must be in the range [0, 1], got {}", + "the distribution sigma must be in the range ]0, 1], got {}", value.sigma ), },