Closed
Description
There are two ways to encode values into json in string form, and they can provide different results or be wrong:
- ToJson transforms a rust value to Json, which can be encoded by a
serialize::Encoder
json::Encoder
implements theEncoder
trait, so you can give it arbitrary values, as long as they implementEncodable
, and it will output json, or json-like text.
We need to provide a single method of encoding to Json, and make sure we use serialize
correctly if we use it.
The ToJson trait expresses the restriction that only maps with string keys can be encoded to Json. This is easy to step around by using the other json encoding method, which results in invalid json.
Metadata
Metadata
Assignees
Labels
No labels