Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
1
use serde_json::{Result, Value};
2
3
fn parse_json(json_string: &str) -> Result<Value> {
4
let json: Value = serde_json::from_str(json_string)?;
5
Ok(json)
6
}
7
8
fn main() {
9
let json_string = r#"
Callers
1
main
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected