diff --git a/src/utils.rs b/src/utils.rs index a15734d..5f633c0 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -67,10 +67,8 @@ impl SsbMessageValue { /// /// * `value` - A serde value to be parsed into a TypedMessage. pub fn get_typed_message_from_value(value: Value) -> Result { - let message_type = value.get("type").ok_or(GolgiError::ContentTypeDecode("no type field in content".to_string()))?; - let message_type_str = message_type.as_str().ok_or(GolgiError::ContentTypeDecode("invalid type field in content".to_string()))?; - let to_return: TypedMessage = serde_json::from_value(value)?; - Ok(to_return) + let typed_message: TypedMessage = serde_json::from_value(value)?; + Ok(typed_message) } /// Data type representing the `value` of a message object (`KVT`),