diff --git a/src/formats/serde.rs b/src/formats/serde.rs index 6023240..23be10a 100644 --- a/src/formats/serde.rs +++ b/src/formats/serde.rs @@ -22,19 +22,21 @@ where pub fn serialize_hints( hints: &HashMap, - serializer: Serializer, -) -> Result { + serializer: S, +) -> Result +where + S: Serializer, +{ let mut hint_map = serde_json::Map::new(); for hint in hints { - if let (hint_name, hint_val) = hint { - let mut h = serde_json::Map::new(); - let sig = hint_val.value_signature(); - let val = hint_val.try_clone(); - h.insert(sig.to_string(), serde_json::Value::String(val)); + let (hint_name, hint_val) = hint; + let mut h = serde_json::Map::new(); + let sig = hint_val.value_signature(); + let val = hint_val.try_clone(); + h.insert(sig.to_string(), serde_json::Value::String(val)); - hint_map.insert(hint_name.clone(), serde_json::Value::Object(h.clone())); - } + hint_map.insert(hint_name.clone(), serde_json::Value::Object(h.clone())); } hint_map.serialize(serializer)