Parse A JSON String With Serde In Rust

rust

```cargo
[dependencies]
 serde_json = "1.0.111"
```

use serde_json::Value;

fn main() {
  let text = r#"{ "color": "red" }"#;
  match serde_json::from_str::<Value>(text) {
    Ok(data) => { dbg!(data); () } ,
    Err(e) => { dbg!(e); () }
  };
}
            
[/Users/alan/.cargo/target/55/19854259915251/_active_nvim_run:11:19] data = Object {
    "color": String("red"),
}
        
  • This is a little different from the example which uses ? to get the Result. I don't have my head fully around that so I'm using this approach