The only reason we were using serde_json::json![...] was to have something to feed into the ContentHash hasher. We didn't need the JSON itself as anything other than a sequence of bytes.
Rather than spending the time to serialize everything as JSON, just to feed the string representation as a sequence of bytes to the hasher, we now feed the values in directly to the hasher as sequences of bytes, bypassing the JSON serialization entirely.
The only reason we were using
serde_json::json![...]
was to have something to feed into theContentHash
hasher. We didn't need the JSON itself as anything other than a sequence of bytes.Rather than spending the time to serialize everything as JSON, just to feed the string representation as a sequence of bytes to the hasher, we now feed the values in directly to the hasher as sequences of bytes, bypassing the JSON serialization entirely.