MCPcopy Create free account
hub / github.com/SixArm/rust-quick-guide / parse_json

Function parse_json

projects/crates/serde/parse_json_data/src/main.rs:3–6  ·  view source on GitHub ↗
(json_string: &str)

Source from the content-addressed store, hash-verified

1use serde_json::{Result, Value};
2
3fn parse_json(json_string: &str) -> Result<Value> {
4 let json: Value = serde_json::from_str(json_string)?;
5 Ok(json)
6}
7
8fn main() {
9 let json_string = r#"

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected