MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / write_json_string

Function write_json_string

atomic-canonical/src/jcs.rs:67–69  ·  view source on GitHub ↗

Emit a JSON string with standard escaping. `serde_json` produces a valid, minimally-escaped JSON string literal (quotes included), which matches JCS for the ASCII content in our records.

(out: &mut String, s: &str)

Source from the content-addressed store, hash-verified

65/// minimally-escaped JSON string literal (quotes included), which matches JCS
66/// for the ASCII content in our records.
67fn write_json_string(out: &mut String, s: &str) {
68 out.push_str(&serde_json::to_string(s).expect("string serialization is infallible"));
69}
70
71#[cfg(test)]
72mod tests {

Callers 1

write_valueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected