diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 5edbf17..14d5f4d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use reqwest::blocking::ClientBuilder; +use serde::Deserialize; const USER_AGENT: &'static str = concat!( @@ -8,6 +9,18 @@ const USER_AGENT: &'static str = concat!( ); +#[derive(Debug, Deserialize)] +struct Repo { + id: usize, + name: String, + description: Option<String>, + fork: bool, + git_url: String, + default_branch: String, + updated_at: String, // TODO: Maybe parse to date? +} + + fn main() { let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Accept", "application/vnd.github.v3+json".parse().unwrap()); @@ -26,6 +39,8 @@ fn main() { ), ) .send() + .unwrap() + .json::<Vec<Repo>>() .unwrap(); dbg!(&response); |