from 0.1.4

A procedural macro that generates custom parsing and validation code
Documentation
1
2
3
4
5
6
7
#[inline(always)]
pub fn string_to_json(s: &String) -> String {
    let mut json = String::from('"');
    json.push_str(&s.replace('\\', r#"\\"#).replace('"', r#"\""#));
    json.push('"');
    json
}