[−][src]Function edn_rs::emit_edn
pub fn emit_edn(json: String) -> String
emit_edn
receives a json string and parses its common key-values to a regular EDN format.
tested examples are:
"{\"hello world\": \"julia\"}"
becomes"{:hello-world \"julia\"}"
"{\"hello\": null}"
becomes"{:hello nil}"
{\"hello\": 'c'}
becomes"{:hello \\c}"
"{\"multi_string with underscore\": 545643}"
becomes"{:multi-string-with-underscore 545643}"
use edn_rs::emit_edn; fn emits_helloworld_edn() { let json = String::from("{\"hello\": \"world\"}"); let edn = String::from("{:hello \"world\"}"); assert_eq!(edn, emit_edn(json)); }