Skip to content

Instantly share code, notes, and snippets.

@selfup
Created May 22, 2016 23:10
Show Gist options
  • Save selfup/12fef2ccb335cf754ab89f529ed016aa to your computer and use it in GitHub Desktop.
Save selfup/12fef2ccb335cf754ab89f529ed016aa to your computer and use it in GitHub Desktop.
#[no_mangle]
pub extern fn read_json(ro: &'static str) -> String {
let roo = ro.to_string();
let json_for_rust: HashMap<String, i32> = json::decode(&roo).unwrap();
let encoded = json::encode(&json_for_rust).unwrap();
encoded
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment