MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / main

Function main

1d_json/rust/json/src/bin/person.rs:12–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10}
11
12fn main() {
13 let bob = Person {
14 name: "Bob".to_string(),
15 age: 12,
16 verified: true,
17 job: None,
18 parents: ["Alice".to_string(), "Carl".to_string()].to_vec(),
19 };
20 let json = serde_json::to_string(&bob).unwrap();
21 println!("{}", &json);
22
23 let person: Person = serde_json::from_str(&json).unwrap();
24
25 println!("{:?}", person);
26}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected