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 }