Browse Source

Merge pull request #4930 from whitfin/patch-2

Update Rust edition in Gotham tests
Mike Smith 6 years ago
parent
commit
90f77759ef
36 changed files with 314 additions and 1001 deletions
  1. 1 1
      frameworks/Rust/actix/actix-core.dockerfile
  2. 1 1
      frameworks/Rust/actix/actix-diesel.dockerfile
  3. 1 1
      frameworks/Rust/actix/actix-pg.dockerfile
  4. 1 1
      frameworks/Rust/actix/actix-raw.dockerfile
  5. 1 1
      frameworks/Rust/actix/actix.dockerfile
  6. 1 0
      frameworks/Rust/gotham/Cargo.toml
  7. 1 1
      frameworks/Rust/gotham/gotham.dockerfile
  8. 1 0
      frameworks/Rust/hyper/Cargo.toml
  9. 1 1
      frameworks/Rust/hyper/hyper-db.dockerfile
  10. 1 1
      frameworks/Rust/hyper/hyper.dockerfile
  11. 6 7
      frameworks/Rust/hyper/src/db.rs
  12. 8 9
      frameworks/Rust/hyper/src/main.rs
  13. 14 21
      frameworks/Rust/hyper/src/main_db.rs
  14. 7 7
      frameworks/Rust/hyper/src/server.rs
  15. 1 0
      frameworks/Rust/iron/Cargo.toml
  16. 1 1
      frameworks/Rust/iron/iron.dockerfile
  17. 107 95
      frameworks/Rust/iron/src/main.rs
  18. 1 0
      frameworks/Rust/may-minihttp/Cargo.toml
  19. 1 1
      frameworks/Rust/nickel/Cargo.toml
  20. 1 1
      frameworks/Rust/nickel/nickel.dockerfile
  21. 20 15
      frameworks/Rust/nickel/src/main.rs
  22. 1 0
      frameworks/Rust/rocket/Cargo.toml
  23. 5 5
      frameworks/Rust/rocket/src/db.rs
  24. 25 19
      frameworks/Rust/rocket/src/main.rs
  25. 1 0
      frameworks/Rust/rouille/Cargo.toml
  26. 1 1
      frameworks/Rust/rouille/rouille.dockerfile
  27. 13 11
      frameworks/Rust/rouille/src/main.rs
  28. 3 3
      frameworks/Rust/saphir/saphir.dockerfile
  29. 13 10
      frameworks/Rust/saphir/src/main.rs
  30. 1 0
      frameworks/Rust/thruster/Cargo.toml
  31. 34 34
      frameworks/Rust/thruster/src/context.rs
  32. 1 1
      frameworks/Rust/thruster/thruster.dockerfile
  33. 0 722
      frameworks/Rust/tokio-minihttp/Cargo.lock
  34. 1 0
      frameworks/Rust/tokio-minihttp/Cargo.toml
  35. 37 29
      frameworks/Rust/tokio-minihttp/src/main.rs
  36. 1 1
      frameworks/Rust/tokio-minihttp/tokio-minihttp.dockerfile

+ 1 - 1
frameworks/Rust/actix/actix-core.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.35
+FROM rust:1.36
 
 ADD ./ /actix
 WORKDIR /actix

+ 1 - 1
frameworks/Rust/actix/actix-diesel.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.35
+FROM rust:1.36
 
 ADD ./ /actix
 WORKDIR /actix

+ 1 - 1
frameworks/Rust/actix/actix-pg.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.35
+FROM rust:1.36
 
 ADD ./ /actix
 WORKDIR /actix

+ 1 - 1
frameworks/Rust/actix/actix-raw.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.35
+FROM rust:1.36
 
 ADD ./ /actix
 WORKDIR /actix

+ 1 - 1
frameworks/Rust/actix/actix.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.35
+FROM rust:1.36
 
 ADD ./ /actix
 WORKDIR /actix

+ 1 - 0
frameworks/Rust/gotham/Cargo.toml

@@ -2,6 +2,7 @@
 name = "gotham_techempower"
 version = "0.1.0"
 authors = ["Isaac Whitfield <[email protected]>"]
+edition = "2018"
 
 [dependencies]
 gotham = "0.4"

+ 1 - 1
frameworks/Rust/gotham/gotham.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.36.0
+FROM rust:1.36
 
 WORKDIR /gotham
 COPY ./src ./src

+ 1 - 0
frameworks/Rust/hyper/Cargo.toml

@@ -1,6 +1,7 @@
 [package]
 name = "hyper-techempower"
 version = "0.5.0"
+edition = "2018"
 authors = [
     "Steve Klabnik <[email protected]>",
     "Alexander Polyakov <[email protected]>",

+ 1 - 1
frameworks/Rust/hyper/hyper-db.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.35
+FROM rust:1.36
 
 ADD ./ /hyper
 WORKDIR /hyper

+ 1 - 1
frameworks/Rust/hyper/hyper.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.35
+FROM rust:1.36
 
 ADD ./ /hyper
 WORKDIR /hyper

+ 6 - 7
frameworks/Rust/hyper/src/db.rs

@@ -15,7 +15,11 @@ pub struct Fortune {
     pub message: String,
 }
 
-pub fn connect(addr: SocketAddr, config: Config, handle: Handle) -> impl Future<Item = Db, Error = ()> {
+pub fn connect(
+    addr: SocketAddr,
+    config: Config,
+    handle: Handle,
+) -> impl Future<Item = Db, Error = ()> {
     TcpStream::connect(&addr, &handle)
         .map_err(|e| panic!("error connecting to postgresql: {}", e))
         .and_then(move |tcp| {
@@ -29,12 +33,7 @@ pub fn connect(addr: SocketAddr, config: Config, handle: Handle) -> impl Future<
             client
                 .prepare("SELECT id, message FROM fortune")
                 .map_err(|_| ())
-                .map(move |fortune| {
-                    Db {
-                        client,
-                        fortune,
-                    }
-                })
+                .map(move |fortune| Db { client, fortune })
         })
 }
 

+ 8 - 9
frameworks/Rust/hyper/src/main.rs

@@ -7,12 +7,11 @@ extern crate serde_derive;
 extern crate serde_json;
 extern crate tokio_core;
 
-
 use futures::Future;
 
-use hyper::{Body, Response, StatusCode};
-use hyper::header::{CONTENT_LENGTH, CONTENT_TYPE, SERVER, HeaderValue};
+use hyper::header::{HeaderValue, CONTENT_LENGTH, CONTENT_TYPE, SERVER};
 use hyper::service::service_fn_ok;
+use hyper::{Body, Response, StatusCode};
 
 mod server;
 
@@ -23,7 +22,6 @@ struct JsonResponse<'a> {
     message: &'a str,
 }
 
-
 fn main() {
     // It seems most of the other benchmarks create static header values
     // for performance, so just play by the same rules here...
@@ -65,7 +63,9 @@ fn main() {
                     Body::from(HELLO_WORLD)
                 }
                 "/json" => {
-                    let rep = JsonResponse { message: "Hello, world!" };
+                    let rep = JsonResponse {
+                        message: "Hello, world!",
+                    };
                     let rep_body = serde_json::to_vec(&rep).unwrap();
                     headers.insert(CONTENT_LENGTH, json_len.clone());
                     headers.insert(CONTENT_TYPE, json_ct.clone());
@@ -76,7 +76,7 @@ fn main() {
                     *res.status_mut() = StatusCode::NOT_FOUND;
                     *res.headers_mut() = headers;
                     return res;
-                },
+                }
             };
 
             headers.insert(SERVER, server_header.clone());
@@ -88,9 +88,8 @@ fn main() {
 
         // Spawn the `serve_connection` future into the runtime.
         handle.spawn(
-            http
-                .serve_connection(socket, svc)
-                .map_err(|e| eprintln!("connection error: {}", e))
+            http.serve_connection(socket, svc)
+                .map_err(|e| eprintln!("connection error: {}", e)),
         );
     })
 }

+ 14 - 21
frameworks/Rust/hyper/src/main_db.rs

@@ -8,7 +8,7 @@ use std::fmt::Write;
 use std::net::ToSocketAddrs;
 
 use futures::{future, Future};
-use hyper::header::{CONTENT_TYPE, SERVER, HeaderValue};
+use hyper::header::{HeaderValue, CONTENT_TYPE, SERVER};
 use hyper::service::service_fn;
 use hyper::{Body, Response};
 
@@ -37,8 +37,8 @@ fn main() {
         let server_header = HeaderValue::from_static("hyper");
 
         // Before handling any requests, we should grab a DB connection.
-        let db_fut = db::connect(psql_addr, psql_config.clone(), handle.clone())
-            .map(move |mut db_conn| {
+        let db_fut =
+            db::connect(psql_addr, psql_config.clone(), handle.clone()).map(move |mut db_conn| {
                 let html_ct = html_ct.clone();
                 let server_header = server_header.clone();
 
@@ -57,35 +57,28 @@ fn main() {
 
                     match req.uri.path() {
                         "/fortune" => {
-                            future::Either::A(db_conn
-                                .tell_fortune()
-                                .map(move |fortunes| {
-                                    let mut buf = String::with_capacity(2048);
-                                    let _ = write!(&mut buf, "{}", FortunesTemplate {
-                                        fortunes,
-                                    });
-                                    let mut res = Response::new(Body::from(buf));
-                                    *res.headers_mut() = headers;
-                                    res
-                                }))
-                        },
+                            future::Either::A(db_conn.tell_fortune().map(move |fortunes| {
+                                let mut buf = String::with_capacity(2048);
+                                let _ = write!(&mut buf, "{}", FortunesTemplate { fortunes });
+                                let mut res = Response::new(Body::from(buf));
+                                *res.headers_mut() = headers;
+                                res
+                            }))
+                        }
                         _ => {
                             let mut res = Response::new(Body::empty());
                             *res.status_mut() = hyper::StatusCode::NOT_FOUND;
                             *res.headers_mut() = headers;
                             future::Either::B(future::ok(res))
-                        },
+                        }
                     }
                 });
 
-
                 // Spawn the `serve_connection` future into the runtime.
                 handle2.spawn(
-                    http
-                        .serve_connection(socket, svc)
-                        .map_err(|e| eprintln!("connection error: {}", e))
+                    http.serve_connection(socket, svc)
+                        .map_err(|e| eprintln!("connection error: {}", e)),
                 );
-
             });
         handle.spawn(db_fut);
     });

+ 7 - 7
frameworks/Rust/hyper/src/server.rs

@@ -4,8 +4,8 @@ use std::thread;
 
 use futures::{Future, Stream};
 use hyper::server::conn::Http;
-use tokio_core::reactor::{Core, Handle};
 use tokio_core::net::{TcpListener, TcpStream};
+use tokio_core::reactor::{Core, Handle};
 
 pub(crate) fn run<F>(per_connection: F)
 where
@@ -35,11 +35,11 @@ where
 
     // Bind to 0.0.0.0:8080
     let addr = SocketAddr::from(([0, 0, 0, 0], 8080));
-    let tcp = reuse_listener(&addr, &handle)
-        .expect("couldn't bind to addr");
+    let tcp = reuse_listener(&addr, &handle).expect("couldn't bind to addr");
 
     // For every accepted connection, spawn an HTTP task
-    let server = tcp.incoming()
+    let server = tcp
+        .incoming()
         .for_each(move |(sock, _addr)| {
             let _ = sock.set_nodelay(true);
             per_connection(sock, &mut http, &handle);
@@ -66,7 +66,7 @@ fn reuse_listener(addr: &SocketAddr, handle: &Handle) -> io::Result<TcpListener>
 
     builder.reuse_address(true)?;
     builder.bind(addr)?;
-    builder.listen(1024).and_then(|l| {
-        TcpListener::from_listener(l, addr, handle)
-    })
+    builder
+        .listen(1024)
+        .and_then(|l| TcpListener::from_listener(l, addr, handle))
 }

+ 1 - 0
frameworks/Rust/iron/Cargo.toml

@@ -1,6 +1,7 @@
 [package]
 name = "iron"
 version = "0.0.4"
+edition = "2018"
 
 [dependencies]
 serde = "1.0"

+ 1 - 1
frameworks/Rust/iron/iron.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.29.1
+FROM rust:1.36
 
 ADD ./ /iron
 WORKDIR /iron

+ 107 - 95
frameworks/Rust/iron/src/main.rs

@@ -1,26 +1,28 @@
 extern crate iron;
 extern crate persistent;
-#[macro_use] extern crate router;
+#[macro_use]
+extern crate router;
 extern crate serde;
 extern crate serde_json;
-#[macro_use] extern crate serde_derive;
+#[macro_use]
+extern crate serde_derive;
 extern crate hyper;
-extern crate rand;
-extern crate r2d2;
+extern crate mustache;
 extern crate postgres;
+extern crate r2d2;
 extern crate r2d2_postgres;
-extern crate mustache;
+extern crate rand;
 extern crate rustc_serialize;
 
+use hyper::header::{ContentType, Server};
+use iron::modifiers::Header;
 use iron::prelude::*;
 use iron::status;
-use iron::modifiers::Header;
 use iron::typemap::Key;
-use hyper::header::{Server, ContentType};
-use rand::distributions::{Range, IndependentSample};
-use r2d2_postgres::{PostgresConnectionManager, TlsMode};
-use persistent::{Read};
+use persistent::Read;
 use r2d2::Pool;
+use r2d2_postgres::{PostgresConnectionManager, TlsMode};
+use rand::distributions::{IndependentSample, Range};
 
 #[derive(Serialize, Deserialize)]
 struct Message {
@@ -31,61 +33,74 @@ struct Message {
 #[derive(Serialize, Deserialize, Clone)]
 struct DatabaseRow {
     id: i32,
-    randomNumber: i32
+    randomNumber: i32,
 }
 
 struct CachedRows;
-impl Key for CachedRows { type Value = Vec<DatabaseRow>; }
+impl Key for CachedRows {
+    type Value = Vec<DatabaseRow>;
+}
 
 pub type PostgresPool = Pool<PostgresConnectionManager>;
 
 struct DbPool;
-impl Key for DbPool { type Value = PostgresPool; }
+impl Key for DbPool {
+    type Value = PostgresPool;
+}
 
 struct FortuneTemplate;
-impl Key for FortuneTemplate { type Value = mustache::Template; }
+impl Key for FortuneTemplate {
+    type Value = mustache::Template;
+}
 
 #[derive(RustcEncodable)]
 struct FortuneRow {
     id: i32,
-    message: String
+    message: String,
 }
 
 fn main() {
     let r2d2_config = r2d2::Config::default();
     let pg_conn_manager = PostgresConnectionManager::new(
         "postgres://benchmarkdbuser:benchmarkdbpass@tfb-database/hello_world",
-        TlsMode::None).unwrap();
+        TlsMode::None,
+    )
+    .unwrap();
     let pool = r2d2::Pool::new(r2d2_config, pg_conn_manager).unwrap();
-    let template = mustache::compile_str("<!DOCTYPE html>
+    let template = mustache::compile_str(
+        "<!DOCTYPE html>
     <html> <head><title>Fortunes</title></head>
     <body> <table> 
     <tr><th>id</th><th>message</th></tr> 
     {{#.}} <tr><td>{{id}}</td><td>{{message}}</td></tr> 
     {{/.}} 
-    </table> </body> </html>").unwrap();
+    </table> </body> </html>",
+    )
+    .unwrap();
 
     let mut cached_rows: Vec<DatabaseRow> = Vec::with_capacity(10000);
     let conn = pool.get().unwrap();
 
     for num in 1..10000 {
-        let rows = &conn.query("SELECT id, randomnumber FROM World WHERE id = $1",&[&num]).unwrap();
+        let rows = &conn
+            .query("SELECT id, randomnumber FROM World WHERE id = $1", &[&num])
+            .unwrap();
         let row = rows.get(0);
         cached_rows.push(DatabaseRow {
             id: row.get(0),
-            randomNumber: row.get(1)
+            randomNumber: row.get(1),
         });
     }
 
     let app = router!(
-            json: get "/json" => json_handler,
-            single_db_query: get "/db" => single_db_query_handler,
-            plaintext: get "/plaintext" => plaintext_handler,
-            queries: get "/queries" => queries_handler,
-            cachedworlds: get "/cached-worlds" => cached_queries_handler,
-            fortune: get "/fortune" => fortune_handler,
-            updates: get "/updates" => updates_handler
-        );
+        json: get "/json" => json_handler,
+        single_db_query: get "/db" => single_db_query_handler,
+        plaintext: get "/plaintext" => plaintext_handler,
+        queries: get "/queries" => queries_handler,
+        cachedworlds: get "/cached-worlds" => cached_queries_handler,
+        fortune: get "/fortune" => fortune_handler,
+        updates: get "/updates" => updates_handler
+    );
     let mut middleware = Chain::new(app);
     middleware.link(Read::<DbPool>::both(pool));
     middleware.link(Read::<FortuneTemplate>::both(template));
@@ -96,25 +111,22 @@ fn main() {
 }
 
 fn json_handler(_: &mut Request) -> IronResult<Response> {
-    let message: Message = Message { 
-        message: "Hello, World!".to_owned() 
+    let message: Message = Message {
+        message: "Hello, World!".to_owned(),
     };
     let content_type = Header(ContentType::json());
     let server = Header(Server("Iron".to_owned()));
-    Ok(Response::with(
-        (status::Ok,
+    Ok(Response::with((
+        status::Ok,
         serde_json::to_string(&message).unwrap(),
         content_type,
-        server
-        )))
+        server,
+    )))
 }
 
 fn plaintext_handler(_: &mut Request) -> IronResult<Response> {
     let server = Header(Server("Iron".to_owned()));
-    Ok(Response::with((
-        status::Ok, 
-        "Hello, World!", 
-        server)))
+    Ok(Response::with((status::Ok, "Hello, World!", server)))
 }
 
 fn single_db_query_handler(req: &mut Request) -> IronResult<Response> {
@@ -127,8 +139,8 @@ fn single_db_query_handler(req: &mut Request) -> IronResult<Response> {
         status::Ok,
         serde_json::to_string(&row).unwrap(),
         server,
-        content_type
-        )))
+        content_type,
+    )))
 }
 
 fn queries_handler(req: &mut Request) -> IronResult<Response> {
@@ -141,23 +153,22 @@ fn queries_handler(req: &mut Request) -> IronResult<Response> {
             Ok(m) => match m {
                 e @ 1...500 => e,
                 e if e > 500 => 500,
-                _ => 1
+                _ => 1,
             },
-            _ => 1
+            _ => 1,
         },
-        _ => 1
+        _ => 1,
     };
     let mut res: Vec<DatabaseRow> = Vec::with_capacity(param);
     for _ in 0..param {
         let conn = pool.get().unwrap();
         res.push(random_row(conn))
-    };
-    Ok(
-        Response::with((
-            status::Ok, 
-            serde_json::to_string(&res).unwrap(),
-            server,
-            content_type
+    }
+    Ok(Response::with((
+        status::Ok,
+        serde_json::to_string(&res).unwrap(),
+        server,
+        content_type,
     )))
 }
 
@@ -171,26 +182,25 @@ fn cached_queries_handler(req: &mut Request) -> IronResult<Response> {
             Ok(m) => match m {
                 e @ 1...500 => e,
                 e if e > 500 => 500,
-                _ => 1
+                _ => 1,
             },
-            _ => 1
+            _ => 1,
         },
-        _ => 1
+        _ => 1,
     };
 
     let mut res: Vec<DatabaseRow> = Vec::with_capacity(param);
     for _ in 0..param {
         let mut rng = rand::thread_rng();
-        let between = Range::new(1,10000);
+        let between = Range::new(1, 10000);
         let num = between.ind_sample(&mut rng);
         res.push(cached_rows[num].to_owned())
-    };
-    Ok(
-        Response::with((
-            status::Ok,
-            serde_json::to_string(&res).unwrap(),
-            server,
-            content_type
+    }
+    Ok(Response::with((
+        status::Ok,
+        serde_json::to_string(&res).unwrap(),
+        server,
+        content_type,
     )))
 }
 
@@ -200,31 +210,27 @@ fn fortune_handler(req: &mut Request) -> IronResult<Response> {
     let template = req.get::<Read<FortuneTemplate>>().unwrap();
     let pool = req.get::<Read<DbPool>>().unwrap();
     let conn = pool.get().unwrap();
-    let query_res = &conn.query("SELECT id, message FROM Fortune",&[]).unwrap();
+    let query_res = &conn.query("SELECT id, message FROM Fortune", &[]).unwrap();
     let query_res_iter = query_res.iter();
-    let mut rows: Vec<FortuneRow> = query_res_iter.map(|row| FortuneRow {
-        id: row.get(0),
-        message: row.get(1)
-    }).collect();
+    let mut rows: Vec<FortuneRow> = query_res_iter
+        .map(|row| FortuneRow {
+            id: row.get(0),
+            message: row.get(1),
+        })
+        .collect();
     rows.push(FortuneRow {
         id: 0,
-        message: "Additional fortune added at request time.".to_string()
+        message: "Additional fortune added at request time.".to_string(),
     });
     rows.sort_by(|it, next| it.message.cmp(&next.message));
     let mut res = vec![];
     template.render(&mut res, &rows).unwrap();
-    Ok(
-        Response::with((
-            status::Ok,
-            res,
-            server,
-            content_type
-    )))
+    Ok(Response::with((status::Ok, res, server, content_type)))
 }
 
 fn updates_handler(req: &mut Request) -> IronResult<Response> {
     let mut rng = rand::thread_rng();
-    let between = Range::new(1,10000);
+    let between = Range::new(1, 10000);
     let content_type = Header(ContentType::json());
     let server = Header(Server("Iron".to_owned()));
     let pool = req.get::<Read<DbPool>>().unwrap();
@@ -234,58 +240,64 @@ fn updates_handler(req: &mut Request) -> IronResult<Response> {
             Ok(m) => match m {
                 e @ 1...500 => e,
                 e if e > 500 => 500,
-                _ => 1
+                _ => 1,
             },
-            _ => 1
+            _ => 1,
         },
-        _ => 1
+        _ => 1,
     };
     let mut dbres: Vec<DatabaseRow> = Vec::with_capacity(param);
     for _ in 0..param {
         let conn = pool.get().unwrap();
         dbres.push(random_row(conn))
-    };
+    }
     let conn = pool.get().unwrap();
     let trans = conn.transaction().unwrap();
     // Sorting guarantees no deadlocks between multiple concurrent threads
-    dbres.sort_by_key(|it| it.id );
+    dbres.sort_by_key(|it| it.id);
     let mut res: Vec<DatabaseRow> = Vec::with_capacity(param);
     for row in dbres {
         let num = between.ind_sample(&mut rng);
-        trans.execute("UPDATE World SET randomnumber = $1 WHERE id = $2", &[&num, &row.id]).unwrap();
+        trans
+            .execute(
+                "UPDATE World SET randomnumber = $1 WHERE id = $2",
+                &[&num, &row.id],
+            )
+            .unwrap();
         res.push(DatabaseRow {
             id: row.id,
-            randomNumber: num 
+            randomNumber: num,
         })
     }
     trans.commit().unwrap();
-    Ok(
-        Response::with((
-            status::Ok,
-            serde_json::to_string(&res).unwrap(),
-            server,
-            content_type
+    Ok(Response::with((
+        status::Ok,
+        serde_json::to_string(&res).unwrap(),
+        server,
+        content_type,
     )))
 }
 
 fn random_row(conn: r2d2::PooledConnection<PostgresConnectionManager>) -> DatabaseRow {
     let mut rng = rand::thread_rng();
-    let between = Range::new(1,10000);
+    let between = Range::new(1, 10000);
     let num = between.ind_sample(&mut rng);
-    let rows = &conn.query("SELECT id, randomnumber FROM World WHERE id = $1",&[&num]).unwrap();
+    let rows = &conn
+        .query("SELECT id, randomnumber FROM World WHERE id = $1", &[&num])
+        .unwrap();
     let row = rows.get(0);
     DatabaseRow {
         id: row.get(0),
-        randomNumber: row.get(1)
+        randomNumber: row.get(1),
     }
 }
 
 fn get_param<'a>(querystring: &'a str, param: &'a str) -> Option<&'a str> {
-    let n = querystring.split("&").find(
-        |&it| !(it.find(param).is_none())
-    ); 
+    let n = querystring
+        .split("&")
+        .find(|&it| !(it.find(param).is_none()));
     match n {
         Some(n) => n.split("=").nth(1),
-        _ => n
+        _ => n,
     }
 }

+ 1 - 0
frameworks/Rust/may-minihttp/Cargo.toml

@@ -2,6 +2,7 @@
 name = "may-minihttp"
 version = "0.1.0"
 authors = ["Xudong Huang <[email protected]>"]
+edition = "2018"
 
 [dependencies]
 mimalloc = "0.1"

+ 1 - 1
frameworks/Rust/nickel/Cargo.toml

@@ -1,7 +1,7 @@
 [package]
-
 name = "nickel"
 version = "0.0.2"
+edition = "2018"
 
 [dependencies]
 serde = "1.0"

+ 1 - 1
frameworks/Rust/nickel/nickel.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.29.1
+FROM rust:1.36
 
 ADD ./ /nickel
 WORKDIR /nickel

+ 20 - 15
frameworks/Rust/nickel/src/main.rs

@@ -2,9 +2,10 @@
 extern crate nickel;
 extern crate serde;
 extern crate serde_json;
-#[macro_use] extern crate serde_derive;
+#[macro_use]
+extern crate serde_derive;
 
-use nickel::{Nickel, HttpRouter, MediaType};
+use nickel::{HttpRouter, MediaType, Nickel};
 
 #[derive(Serialize, Deserialize)]
 struct Message {
@@ -15,20 +16,24 @@ fn main() {
     let mut server = Nickel::new();
     let mut router = Nickel::router();
 
-    router.get("/json",
-               middleware!{ |_, mut response|
-        response.set(MediaType::Json);
-        let message: Message = Message{
-            message: "Hello, World!".to_string(),
-        };
-        serde_json::to_string(&message).unwrap()
-    });
+    router.get(
+        "/json",
+        middleware! { |_, mut response|
+            response.set(MediaType::Json);
+            let message: Message = Message{
+                message: "Hello, World!".to_string(),
+            };
+            serde_json::to_string(&message).unwrap()
+        },
+    );
 
-    router.get("/plaintext",
-               middleware! { |_, mut response|
-        response.set(MediaType::Txt);
-        "Hello, World!"
-    });
+    router.get(
+        "/plaintext",
+        middleware! { |_, mut response|
+            response.set(MediaType::Txt);
+            "Hello, World!"
+        },
+    );
 
     server.utilize(router);
     server.listen("0.0.0.0:8080").unwrap();

+ 1 - 0
frameworks/Rust/rocket/Cargo.toml

@@ -2,6 +2,7 @@
 name = "rocket"
 version = "0.1.0"
 authors = ["Marcelo Barbosa <[email protected]>"]
+edition = "2018"
 
 [dependencies]
 diesel = { version = "1.3.2", features = ["postgres", "r2d2"] }

+ 5 - 5
frameworks/Rust/rocket/src/db.rs

@@ -1,9 +1,9 @@
-use std::ops::Deref;
-use rocket::http::Status;
-use rocket::request::{self, FromRequest};
-use rocket::{Request, State, Outcome};
 use diesel::pg::PgConnection;
 use diesel::r2d2::{ConnectionManager, Pool, PooledConnection};
+use rocket::http::Status;
+use rocket::request::{self, FromRequest};
+use rocket::{Outcome, Request, State};
+use std::ops::Deref;
 
 type PgPool = Pool<ConnectionManager<PgConnection>>;
 
@@ -16,7 +16,7 @@ impl<'a, 'r> FromRequest<'a, 'r> for DbConn {
         let pool = request.guard::<State<PgPool>>()?;
         match pool.get() {
             Ok(conn) => Outcome::Success(DbConn(conn)),
-            Err(_) => Outcome::Failure((Status::ServiceUnavailable, ()))
+            Err(_) => Outcome::Failure((Status::ServiceUnavailable, ())),
         }
     }
 }

+ 25 - 19
frameworks/Rust/rocket/src/main.rs

@@ -1,10 +1,13 @@
 #![feature(proc_macro_hygiene, decl_macro)]
 
 extern crate rand;
-#[macro_use] extern crate rocket;
+#[macro_use]
+extern crate rocket;
 extern crate rocket_contrib;
-#[macro_use] extern crate diesel;
-#[macro_use] extern crate serde_derive;
+#[macro_use]
+extern crate diesel;
+#[macro_use]
+extern crate serde_derive;
 
 use diesel::prelude::*;
 use diesel::result::Error;
@@ -28,7 +31,7 @@ fn plaintext() -> &'static str {
 #[get("/json")]
 fn json() -> Json<models::Message> {
     let message = models::Message {
-        message: "Hello, World!"
+        message: "Hello, World!",
     };
     Json(message)
 }
@@ -68,7 +71,7 @@ fn queries(conn: db::DbConn, q: u16) -> Json<Vec<models::World>> {
         let result = world
             .filter(id.eq(random_number()))
             .first::<models::World>(&*conn)
-            .expect("error loading world");       
+            .expect("error loading world");
         results.push(result);
     }
 
@@ -82,12 +85,12 @@ fn fortunes(conn: db::DbConn) -> Template {
     let mut context = fortune
         .load::<models::Fortune>(&*conn)
         .expect("error loading fortunes");
-    
-    context.push(models::Fortune { 
+
+    context.push(models::Fortune {
         id: 0,
-        message: "Additional fortune added at request time.".to_string()
+        message: "Additional fortune added at request time.".to_string(),
     });
-    
+
     context.sort_by(|a, b| a.message.cmp(&b.message));
 
     Template::render("fortunes", &context)
@@ -136,16 +139,19 @@ fn updates(conn: db::DbConn, q: u16) -> Json<Vec<models::World>> {
 
 fn main() {
     rocket::ignite()
-        .mount("/", routes![
-            json,
-            plaintext,
-            db,
-            queries,
-            queries_empty,
-            fortunes,
-            updates,
-            updates_empty,
-        ])
+        .mount(
+            "/",
+            routes![
+                json,
+                plaintext,
+                db,
+                queries,
+                queries_empty,
+                fortunes,
+                updates,
+                updates_empty,
+            ],
+        )
         .manage(db::init_pool())
         .attach(Template::fairing())
         .launch();

+ 1 - 0
frameworks/Rust/rouille/Cargo.toml

@@ -2,6 +2,7 @@
 name = "rouille"
 version = "0.1.0"
 authors = ["Gökberk Yaltıraklı <[email protected]>"]
+edition = "2018"
 
 [dependencies]
 rouille = "1.0"

+ 1 - 1
frameworks/Rust/rouille/rouille.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.29.1
+FROM rust:1.36
 
 WORKDIR /rouille
 COPY src src

+ 13 - 11
frameworks/Rust/rouille/src/main.rs

@@ -1,17 +1,19 @@
-#[macro_use] extern crate rouille;
-#[macro_use] extern crate serde_json;
+#[macro_use]
+extern crate rouille;
+#[macro_use]
+extern crate serde_json;
 
 fn main() {
     rouille::start_server("0.0.0.0:8080", move |req| {
         router!(req,
-                (GET) (/plaintext) => {
-                    rouille::Response::from_data("text/plain", "Hello, World!")
-                },
-                (GET) (/json) => {
-                    let json = json!({"message": "Hello, World!"});
-                    rouille::Response::from_data("application/json", json.to_string())
-                },
-                _ => rouille::Response::empty_404()
-            )
+            (GET) (/plaintext) => {
+                rouille::Response::from_data("text/plain", "Hello, World!")
+            },
+            (GET) (/json) => {
+                let json = json!({"message": "Hello, World!"});
+                rouille::Response::from_data("application/json", json.to_string())
+            },
+            _ => rouille::Response::empty_404()
+        )
     });
 }

+ 3 - 3
frameworks/Rust/saphir/saphir.dockerfile

@@ -1,6 +1,6 @@
-FROM rust:1.31.1
+FROM rust:1.36
 
-WORKDIR saphir
+WORKDIR /saphir
 
 ADD . .
 
@@ -9,4 +9,4 @@ RUN cargo build --release
 
 EXPOSE 8080
 
-ENTRYPOINT [ "./target/release/saphir-techempower" ]
+ENTRYPOINT [ "./target/release/saphir-techempower" ]

+ 13 - 10
frameworks/Rust/saphir/src/main.rs

@@ -1,8 +1,8 @@
 extern crate saphir;
 #[macro_use]
 extern crate serde_derive;
-extern crate serde_json;
 extern crate serde;
+extern crate serde_json;
 
 use saphir::*;
 
@@ -19,28 +19,31 @@ fn main() {
     let server = server_builder
         .configure_router(|router| {
             let plaintext = BasicController::new("^/plaintext", ());
-            plaintext.add(Method::GET, reg!("^/$"), |_, _, res| { 
+            plaintext.add(Method::GET, reg!("^/$"), |_, _, res| {
                 res.header(header::CONTENT_TYPE, "text/plain")
                     .header(header::SERVER, "Saphir")
                     .status(StatusCode::OK)
-                    .body(HELLO_WORLD); 
+                    .body(HELLO_WORLD);
             });
 
             let json = BasicController::new("^/json", ());
-            json.add(Method::GET, reg!("^/$"), |_, _, res| { 
-                let body = ResponseJsonBody{ message: "hello, world!" };
-                let json_str = ::serde_json::to_string(&body).expect("this body serialization should never fail");
+            json.add(Method::GET, reg!("^/$"), |_, _, res| {
+                let body = ResponseJsonBody {
+                    message: "hello, world!",
+                };
+                let json_str = ::serde_json::to_string(&body)
+                    .expect("this body serialization should never fail");
                 res.header(header::CONTENT_TYPE, "application/json")
                     .header(header::SERVER, "Saphir")
                     .status(StatusCode::OK)
                     .body(json_str);
             });
 
-            router.add(plaintext)
-            .add(json)
+            router.add(plaintext).add(json)
         })
         .configure_listener(|listener_config| {
-            listener_config.set_uri("http://0.0.0.0:8080")
+            listener_config
+                .set_uri("http://0.0.0.0:8080")
                 .set_request_timeout_ms(5000) // 10 sec
                 .set_panic_handler(|panic| {
                     println!("HA HA! : {:?}", panic);
@@ -49,4 +52,4 @@ fn main() {
         .build();
 
     server.run().unwrap();
-}
+}

+ 1 - 0
frameworks/Rust/thruster/Cargo.toml

@@ -2,6 +2,7 @@
 name = "thruster_techempower"
 version = "0.1.0"
 authors = ["Isaac Whitfield <[email protected]>"]
+edition = "2018"
 
 [dependencies]
 futures = "0.1"

+ 34 - 34
frameworks/Rust/thruster/src/context.rs

@@ -1,51 +1,51 @@
-use std::collections::{HashMap};
 use smallvec::SmallVec;
+use std::collections::HashMap;
 use thruster::{Context, Request, Response};
 
 pub struct Ctx {
-  pub body: String,
-  pub method: String,
-  pub path: String,
-  pub request_body: String,
-  pub params: HashMap<String, String>,
-  pub headers: SmallVec<[(String, String); 8]>,
-  pub status_code: u32,
-  response: Response
+    pub body: String,
+    pub method: String,
+    pub path: String,
+    pub request_body: String,
+    pub params: HashMap<String, String>,
+    pub headers: SmallVec<[(String, String); 8]>,
+    pub status_code: u32,
+    response: Response,
 }
 
 impl Ctx {
-  pub fn set_header(&mut self, key: &str, val: &str) {
-    self.response.header(key, val);
-  }
+    pub fn set_header(&mut self, key: &str, val: &str) {
+        self.response.header(key, val);
+    }
 }
 
 impl Context for Ctx {
-  fn get_response(mut self) -> Response {
-    self.response.status_code(200, "OK");
+    fn get_response(mut self) -> Response {
+        self.response.status_code(200, "OK");
 
-    self.response.body(&self.body);
+        self.response.body(&self.body);
 
-    self.response
-  }
+        self.response
+    }
 
-  fn set_body(&mut self, body: String) {
-    self.body = body;
-  }
+    fn set_body(&mut self, body: String) {
+        self.body = body;
+    }
 }
 
 pub fn generate_context(request: Request) -> Ctx {
-  let method = request.method().to_owned();
-  let path = request.path().to_owned();
-  let request_body = request.raw_body().to_owned();
-
-  Ctx {
-    body: "".to_owned(),
-    method: method,
-    path: path,
-    params: request.params,
-    request_body: request_body,
-    headers: SmallVec::new(),
-    status_code: 200,
-    response: Response::new()
-  }
+    let method = request.method().to_owned();
+    let path = request.path().to_owned();
+    let request_body = request.raw_body().to_owned();
+
+    Ctx {
+        body: "".to_owned(),
+        method: method,
+        path: path,
+        params: request.params,
+        request_body: request_body,
+        headers: SmallVec::new(),
+        status_code: 200,
+        response: Response::new(),
+    }
 }

+ 1 - 1
frameworks/Rust/thruster/thruster.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.29.1
+FROM rust:1.36
 
 WORKDIR /thruster
 COPY ./src ./src

+ 0 - 722
frameworks/Rust/tokio-minihttp/Cargo.lock

@@ -1,722 +0,0 @@
-[root]
-name = "tokio-minihttp"
-version = "0.1.0"
-dependencies = [
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures-cpupool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
- "httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "postgres 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "r2d2 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "r2d2_postgres 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_json 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-minihttp 0.1.0 (git+https://github.com/tokio-rs/tokio-minihttp)",
- "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "antidote"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "base64"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "bitflags"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "block-buffer"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "byte-tools"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "byteorder"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "bytes"
-version = "0.4.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "cfg-if"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "constant_time_eq"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "crypto-mac"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "digest"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "dtoa"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "fake-simd"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "fallible-iterator"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "fuchsia-zircon"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "fuchsia-zircon-sys"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "futures"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "futures-cpupool"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "generic-array"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "typenum 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "hex"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "hmac"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "crypto-mac 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "digest 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "httparse"
-version = "1.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "idna"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "iovec"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "itoa"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "kernel32-sys"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "lazycell"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "libc"
-version = "0.2.33"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "log"
-version = "0.3.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "matches"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "md5"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "memchr"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "mio"
-version = "0.6.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "miow"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "net2"
-version = "0.2.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "nodrop"
-version = "0.1.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "num-traits"
-version = "0.1.40"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "num_cpus"
-version = "1.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "percent-encoding"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "phf"
-version = "0.7.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "phf_shared"
-version = "0.7.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "postgres"
-version = "0.15.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "fallible-iterator 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "postgres-protocol 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "postgres-shared 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "postgres-protocol"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "fallible-iterator 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "hmac 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "md5 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "sha2 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "stringprep 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "postgres-shared"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "fallible-iterator 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
- "postgres-protocol 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "quote"
-version = "0.3.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "r2d2"
-version = "0.7.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "scheduled-thread-pool 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "r2d2_postgres"
-version = "0.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "postgres 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "postgres-shared 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "r2d2 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "rand"
-version = "0.3.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.1.31"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "safemem"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "scheduled-thread-pool"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "scoped-tls"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "serde"
-version = "1.0.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "serde_derive"
-version = "1.0.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde_derive_internals 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "serde_derive_internals"
-version = "0.17.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "serde_json"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
- "serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "sha2"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "block-buffer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "digest 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "siphasher"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "slab"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "slab"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "smallvec"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "stringprep"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "syn"
-version = "0.11.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "synom"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "take"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "time"
-version = "0.1.38"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-core"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "mio 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-io"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-minihttp"
-version = "0.1.0"
-source = "git+https://github.com/tokio-rs/tokio-minihttp#3c7d49917129420466bb9843c4da12dfd2a545ca"
-dependencies = [
- "bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-proto"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
- "rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
- "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "tokio-service"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "typenum"
-version = "1.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "unicode-bidi"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "unicode-normalization"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "unicode-xid"
-version = "0.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "url"
-version = "1.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "winapi"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "winapi-build"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "ws2_32-sys"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[metadata]
-"checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5"
-"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9"
-"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
-"checksum block-buffer 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1339a1042f5d9f295737ad4d9a6ab6bf81c84a933dba110b9200cd6d1448b814"
-"checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40"
-"checksum byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d"
-"checksum bytes 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d828f97b58cc5de3e40c421d0cf2132d6b2da4ee0e11b8632fa838f0f9333ad6"
-"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
-"checksum constant_time_eq 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e"
-"checksum crypto-mac 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "779015233ac67d65098614aec748ac1c756ab6677fa2e14cf8b37c08dfed1198"
-"checksum digest 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e5b29bf156f3f4b3c4f610a25ff69370616ae6e0657d416de22645483e72af0a"
-"checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab"
-"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
-"checksum fallible-iterator 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5d48ab1bc11a086628e8cc0cc2c2dc200b884ac05c4b48fb71d6036b6999ff1d"
-"checksum fuchsia-zircon 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f6c0581a4e363262e52b87f59ee2afe3415361c6ec35e665924eb08afe8ff159"
-"checksum fuchsia-zircon-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "43f3795b4bae048dc6123a6b972cadde2e676f9ded08aef6bb77f5f157684a82"
-"checksum futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "118b49cac82e04121117cbd3121ede3147e885627d82c4546b87c702debb90c1"
-"checksum futures-cpupool 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "e86f49cc0d92fe1b97a5980ec32d56208272cbb00f15044ea9e2799dde766fdf"
-"checksum generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fceb69994e330afed50c93524be68c42fa898c2d9fd4ee8da03bd7363acd26f2"
-"checksum hex 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6a22814455d41612f41161581c2883c0c6a1c41852729b17d5ed88f01e153aa"
-"checksum hmac 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a13f4163aa0c5ca1be584aace0e2212b2e41be5478218d4f657f5f778b2ae2a"
-"checksum httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "af2f2dd97457e8fb1ae7c5a420db346af389926e36f43768b96f101546b04a07"
-"checksum idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "014b298351066f1512874135335d62a789ffe78a9974f94b43ed5621951eaf7d"
-"checksum iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6e8b9c2247fcf6c6a1151f1156932be5606c9fd6f55a2d7f9fc1cb29386b2f7"
-"checksum itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c"
-"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
-"checksum lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3b585b7a6811fb03aa10e74b278a0f00f8dd9b45dc681f148bb29fa5cb61859b"
-"checksum libc 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "5ba3df4dcb460b9dfbd070d41c94c19209620c191b0340b929ce748a2bcd42d2"
-"checksum log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "880f77541efa6e5cc74e76910c9884d9859683118839d6a1dc3b11e63512565b"
-"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376"
-"checksum md5 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b6d9aab58e540f50b59d5cfa7f0da4c3d437476890e1e0b6206e230dce55a23c"
-"checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a"
-"checksum mio 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0e8411968194c7b139e9105bc4ae7db0bae232af087147e72f0616ebf5fdb9cb"
-"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919"
-"checksum net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "3a80f842784ef6c9a958b68b7516bc7e35883c614004dd94959a4dca1b716c09"
-"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"
-"checksum num-traits 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "99843c856d68d8b4313b03a17e33c4bb42ae8f6610ea81b28abe076ac721b9b0"
-"checksum num_cpus 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "514f0d73e64be53ff320680ca671b64fe3fb91da01e1ae2ddc99eb51d453b20d"
-"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
-"checksum phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "cb325642290f28ee14d8c6201159949a872f220c62af6e110a56ea914fbe42fc"
-"checksum phf_shared 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "07e24b0ca9643bdecd0632f2b3da6b1b89bbb0030e0b992afc1113b23a7bc2f2"
-"checksum postgres 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e6dbad8297d43a1319817c45c43fd2cfd6a148767f51baedcdce732635c6526"
-"checksum postgres-protocol 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2b5cf13fd1f61ca10b374a44b7feb0636fce67cd3bd42f925f9186b0e7ccec7b"
-"checksum postgres-shared 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "22fcb88c55471615fea5217b41ab59df5a00665edb4e92f67c35119b7e8948ed"
-"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
-"checksum r2d2 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2c8284508b38df440f8f3527395e23c4780b22f74226b270daf58fee38e4bcce"
-"checksum r2d2_postgres 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f8b19a6ea63676566dd11085217fed98866ca833cea7f6f29be8c2244e0560e"
-"checksum rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6475140dfd8655aeb72e1fd4b7a1cc1c202be65d71669476e392fe62532b9edd"
-"checksum redox_syscall 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "8dde11f18c108289bef24469638a04dce49da56084f2d50618b226e47eb04509"
-"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f"
-"checksum scheduled-thread-pool 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d9fbe48ead32343b76f544c85953bf260ed39219a8bbbb62cd85f6a00f9644f"
-"checksum scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d"
-"checksum serde 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "6eda663e865517ee783b0891a3f6eb3a253e0b0dabb46418969ee9635beadd9e"
-"checksum serde_derive 1.0.21 (registry+https://github.com/rust-lang/crates.io-index)" = "652bc323d694dc925829725ec6c890156d8e70ae5202919869cb00fe2eff3788"
-"checksum serde_derive_internals 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "32f1926285523b2db55df263d2aa4eb69ddcfa7a7eade6430323637866b513ab"
-"checksum serde_json 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e4586746d1974a030c48919731ecffd0ed28d0c40749d0d18d43b3a7d6c9b20e"
-"checksum sha2 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d963c78ce367df26d7ea8b8cc655c651b42e8a1e584e869c1e17dae3ccb116a"
-"checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537"
-"checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23"
-"checksum slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdeff4cd9ecff59ec7e3744cbca73dfe5ac35c2aedb2cfba8a1c715a18912e9d"
-"checksum smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4c8cbcd6df1e117c2210e13ab5109635ad68a929fcbb8964dc965b76cb5ee013"
-"checksum stringprep 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1"
-"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"
-"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6"
-"checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5"
-"checksum time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "d5d788d3aa77bc0ef3e9621256885555368b47bd495c13dd2e7413c89f845520"
-"checksum tokio-core 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "c843a027f7c1df5f81e7734a0df3f67bf329411781ebf36393ce67beef6071e3"
-"checksum tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "514aae203178929dbf03318ad7c683126672d4d96eccb77b29603d33c9e25743"
-"checksum tokio-minihttp 0.1.0 (git+https://github.com/tokio-rs/tokio-minihttp)" = "<none>"
-"checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389"
-"checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162"
-"checksum typenum 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "13a99dc6780ef33c78780b826cf9d2a78840b72cae9474de4bcaf9051e60ebbd"
-"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
-"checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f"
-"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
-"checksum url 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa35e768d4daf1d85733418a49fb42e10d7f633e394fccab4ab7aba897053fe2"
-"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
-"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
-"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"

+ 1 - 0
frameworks/Rust/tokio-minihttp/Cargo.toml

@@ -2,6 +2,7 @@
 name = "tokio-minihttp"
 version = "0.1.0"
 authors = ["Gökberk Yaltıraklı <[email protected]>"]
+edition = "2018"
 
 [dependencies]
 futures = "0.1.9"

+ 37 - 29
frameworks/Rust/tokio-minihttp/src/main.rs

@@ -18,11 +18,11 @@ use std::io;
 
 use futures::future::{self, Either};
 use futures::stream;
-use futures::{BoxFuture, Future, Stream};
-use futures_cpupool::{CpuPool, CpuFuture};
-use r2d2_postgres::{TlsMode, PostgresConnectionManager};
+use futures::{Future, Stream};
+use futures_cpupool::{CpuFuture, CpuPool};
+use r2d2_postgres::{PostgresConnectionManager, TlsMode};
 use rand::Rng;
-use tokio_minihttp::{Request, Response, Http};
+use tokio_minihttp::{Http, Request, Response};
 use tokio_proto::TcpServer;
 use tokio_service::Service;
 use url::Url;
@@ -48,8 +48,8 @@ impl Service for Techempower {
     type Request = Request;
     type Response = Response;
     type Error = std::io::Error;
-    type Future = Either<future::Ok<Response, io::Error>,
-                         BoxFuture<Response, io::Error>>;
+    type Future =
+        Either<future::Ok<Response, io::Error>, Box<Future<Item = Response, Error = io::Error>>>;
 
     fn call(&self, req: Request) -> Self::Future {
         // Bare-bones router
@@ -64,7 +64,6 @@ impl Service for Techempower {
                 Either::A(future::ok(resp))
             }
         }
-
     }
 }
 
@@ -73,40 +72,44 @@ impl Techempower {
         let mut resp = Response::new();
         resp.header("Content-Type", "text/plain")
             .body("Hello, World!");
-        return resp
+        return resp;
     }
 
     fn json(&self) -> Response {
-        let json = Message { message: "Hello, World!" };
+        let json = Message {
+            message: "Hello, World!",
+        };
 
         let mut resp = Response::new();
         resp.header("Content-Type", "application/json")
             .body(&serde_json::to_string(&json).unwrap());
-        return resp
+        return resp;
     }
 
-    fn db(&self) -> BoxFuture<Response, io::Error> {
+    fn db(&self) -> Box<Future<Item = Response, Error = io::Error>> {
         let msg = self.random_world_row();
-        msg.map(|msg| {
+        Box::new(msg.map(|msg| {
             let mut resp = Response::new();
             resp.header("Content-Type", "application/json")
                 .body(&serde_json::to_string(&msg).unwrap());
-            return resp
-        }).boxed()
+            return resp;
+        }))
     }
 
-    fn queries(&self, req: &Request) -> BoxFuture<Response, io::Error> {
+    fn queries(&self, req: &Request) -> Box<Future<Item = Response, Error = io::Error>> {
         let url = format!("http://localhost{}", req.path());
         let url = Url::parse(&url).unwrap();
-        let queries = url.query_pairs().find(|pair| {
-            pair.0 == "queries"
-        }).and_then(|(_, value)| value.parse::<u32>().ok()).unwrap_or(1);
+        let queries = url
+            .query_pairs()
+            .find(|pair| pair.0 == "queries")
+            .and_then(|(_, value)| value.parse::<u32>().ok())
+            .unwrap_or(1);
         let queries = cmp::max(1, queries);
         let queries = cmp::min(500, queries);
 
         let stream = (0..queries).map(|_| self.random_world_row());
 
-        stream::futures_unordered(stream).collect().map(|list| {
+        Box::new(stream::futures_unordered(stream).collect().map(|list| {
             let mut json = Vec::new();
             for row in list {
                 json.push(WorldRow {
@@ -117,20 +120,22 @@ impl Techempower {
             let mut resp = Response::new();
             resp.header("Content-Type", "application/json")
                 .body(&serde_json::to_string(&json).unwrap());
-            return resp
-        }).boxed()
+            return resp;
+        }))
     }
 
     fn random_world_row(&self) -> CpuFuture<WorldRow, io::Error> {
         let random_id = rand::thread_rng().gen_range(1, 10_001);
         let db = self.db_pool.clone();
         self.thread_pool.spawn_fn(move || {
-            let conn = db.get().map_err(|e| {
-                io::Error::new(io::ErrorKind::Other, format!("timeout: {}", e))
-            })?;
-
-            let stmt = conn.prepare_cached("SELECT id,randomNumber \
-                                            FROM World WHERE id = $1")?;
+            let conn = db
+                .get()
+                .map_err(|e| io::Error::new(io::ErrorKind::Other, format!("timeout: {}", e)))?;
+
+            let stmt = conn.prepare_cached(
+                "SELECT id,randomNumber \
+                 FROM World WHERE id = $1",
+            )?;
             let rows = stmt.query(&[&random_id])?;
             let row = rows.get(0);
 
@@ -148,9 +153,12 @@ fn main() {
 
     let dbhost = match option_env!("DBHOST") {
         Some(it) => it,
-        _ => "tfb-database"
+        _ => "tfb-database",
     };
-    let db_url = format!("postgres://benchmarkdbuser:benchmarkdbpass@{}/hello_world", dbhost);
+    let db_url = format!(
+        "postgres://benchmarkdbuser:benchmarkdbpass@{}/hello_world",
+        dbhost
+    );
     let db_config = r2d2::Config::default();
     let db_manager = PostgresConnectionManager::new(&db_url[..], TlsMode::None).unwrap();
     let db_pool = r2d2::Pool::new(db_config, db_manager).unwrap();

+ 1 - 1
frameworks/Rust/tokio-minihttp/tokio-minihttp.dockerfile

@@ -1,4 +1,4 @@
-FROM rust:1.29.1
+FROM rust:1.36
 
 ADD ./ /tokio
 WORKDIR /tokio