diff options
author | David Blajda <blajda@hotmail.com> | 2018-12-09 21:51:41 +0000 |
---|---|---|
committer | David Blajda <blajda@hotmail.com> | 2018-12-09 21:51:41 +0000 |
commit | 89999751d8b0f6c22766af855628e0a93468cec1 (patch) | |
tree | aaca09a259482860e169d0f0db8febf1ade39b71 /src/bin/main.rs | |
parent | 17c6e1ecf82d5a68eccdd62f7a9d757d101759fb (diff) |
clean up reqwest code
Diffstat (limited to 'src/bin/main.rs')
-rw-r--r-- | src/bin/main.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bin/main.rs b/src/bin/main.rs index 8a4c870..08f5abb 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -1,14 +1,23 @@ extern crate twitch_api; extern crate tokio; extern crate dotenv; +extern crate futures; +extern crate serde; use twitch_api::TwitchApi; use std::env; +use futures::future::Future; fn main() { dotenv::dotenv().unwrap(); let mut twitch_api = TwitchApi::new(env::var("TWITCH_API").unwrap()); - let users = twitch_api.users(vec![], vec!["shroud"]); + let mut users = twitch_api.users(vec![], vec!["shroud"]) + .and_then(|json| { + println!("{:?}", json); + Ok(json) + }) + .map(|_| ()) + .map_err(|_| ()); tokio::run(users); } |