I wonder what is the difference between these two crates for serializing/deserializing JSON.
Is one recommended over the other? Is one faster? etc.
It's just that I don't want to have to support both if I can avoid it
I wonder what is the difference between these two crates for serializing/deserializing JSON.
Is one recommended over the other? Is one faster? etc.
It's just that I don't want to have to support both if I can avoid it
I recently switched to serde_json
for one of my projects. Here is my take on it:
Benefits of serde_json
over rustc-serialize
:
#[derive(Serialize, Deserialize)]
and changing the name of fields using annotations (#[serde(rename="bla")]
) and declare specific functions to ser/deser a field (#[serde(deserialize_with="deser_func")]
) etc.Drawbacks of serde_json
compared to rustc-serialize
:
Overall I am pretty happy with serde_json
and I am planning to switch all my projects to it.