cargo fmt (#604)

Run rustfmt and setup CI to check for it.
This commit is contained in:
danieleades
2019-08-29 17:52:39 +01:00
committed by Sean McArthur
parent 81e0f1ff2a
commit cf8944a0f0
41 changed files with 1399 additions and 1378 deletions

View File

@@ -1,11 +1,5 @@
#![deny(warnings)]
extern crate futures;
extern crate reqwest;
extern crate tokio;
extern crate serde;
extern crate serde_json;
use futures::Future;
use reqwest::r#async::{Client, Response};
use serde::Deserialize;
@@ -21,27 +15,18 @@ struct SlideshowContainer {
slideshow: Slideshow,
}
fn fetch() -> impl Future<Item=(), Error=()> {
fn fetch() -> impl Future<Item = (), Error = ()> {
let client = Client::new();
let json = |mut res : Response | {
res.json::<SlideshowContainer>()
};
let json = |mut res: Response| res.json::<SlideshowContainer>();
let request1 =
client
.get("https://httpbin.org/json")
.send()
.and_then(json);
let request1 = client.get("https://httpbin.org/json").send().and_then(json);
let request2 =
client
.get("https://httpbin.org/json")
.send()
.and_then(json);
let request2 = client.get("https://httpbin.org/json").send().and_then(json);
request1.join(request2)
.map(|(res1, res2)|{
request1
.join(request2)
.map(|(res1, res2)| {
println!("{:?}", res1);
println!("{:?}", res2);
})