mozilla-services / canonicaljson-rs

Rust implementation of a Canonical JSON serializer
MIT License
5 stars 2 forks source link

Make `struct ser::JSONFormatter` public #10

Closed alexforster closed 1 year ago

alexforster commented 1 year ago

The "idiomatic" way to make a serde_json formatter is to implement the serde_json::ser::Formatter trait. That's exactly what this crate does, except it doesn't actually expose the implementation to users. Instead, it exposes a helper method called to_string, which hinders more advanced/complex use cases where one might want to pass around a pre-constructed serde_json::Serializer.