add trivial examples
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct HelloWorld {
|
||||
who: String,
|
||||
}
|
||||
fn main() {
|
||||
let json = r#"{
|
||||
"who": "serde"
|
||||
}"#;
|
||||
let hw: HelloWorld = serde_json::from_str(json).unwrap();
|
||||
println!("Hello, {}!", hw.who);
|
||||
}
|
||||
Reference in New Issue
Block a user