add trivial examples

This commit is contained in:
mae
2026-07-13 07:25:54 -05:00
parent d6cef19507
commit 9d4c3e911e
16 changed files with 258 additions and 0 deletions
+13
View File
@@ -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);
}