Demo use of JSON deserialization

It Just Works. Praise the Rust macros.
This commit is contained in:
2025-05-22 18:20:36 -05:00
parent 4d16f8f292
commit 2067964a80

View File

@@ -1,3 +1,4 @@
use gt_tools::ReleaseInfo;
use reqwest::Error;
use reqwest::header::{
@@ -19,7 +20,7 @@ async fn main() -> Result<(), Error> {
.header(ACCEPT, "application/json")
.send()
.await?;
let body_text: String = response.text().await?;
let body_text: Vec<ReleaseInfo> = response.json().await?;
println!("{:?}", body_text);
Ok(())