summary history branches tags files
commit:4d27a986925fb18755f207e815fefcb146e42632
author:Trevor Bentley
committer:Trevor Bentley
date:Sat Mar 10 12:58:38 2018 +0100
parents:90d5e79feedb51ea7b3dd3fc5a2c89e37d8e1830
Remove deprecated .boxed() futures.  Fix failing test for update logic.
diff --git a/src/webapi/test.rs b/src/webapi/test.rs
line changes: +5/-4
index 76654b3..25e9b5e
--- a/src/webapi/test.rs
+++ b/src/webapi/test.rs
@@ -81,6 +81,7 @@ mod tests {
     macro_rules! post {
     ($body_in:ident, $pairs_out:ident, $block_in:block) => {
         {
+            Box::new(
             // Read chunks from user provided body var $body_in
             $body_in.fold(vec![], |mut acc, chunk| {
                 acc.extend(chunk);
@@ -96,7 +97,7 @@ mod tests {
                 let (code, response) = $block_in;
                 let res = Response::new();
                 Ok(res.with_status(code).with_body(response))
-            }).boxed()
+            }))
         }
     };
     }
@@ -127,12 +128,12 @@ mod tests {
                 type Request = Request;
                 type Response = Response;
                 type Error = hyper::Error;
-                type Future = futures::BoxFuture<Response, hyper::Error>;
+                type Future = Box<Future<Item = Self::Response, Error = Self::Error>>;
                 fn call(&self, req: Request) -> Self::Future {
                     let (method, uri, _, _headers, body) = req.deconstruct();
                     match(method, uri.path()) {
                         (Post, "/api/token") => post!(body, pairs, { token_response(&pairs) }),
-                        _ => futures::future::ok(Response::new().with_status(StatusCode::NotFound)).boxed(),
+                        _ => Box::new(futures::future::ok(Response::new().with_status(StatusCode::NotFound))),
                     }
                 }
             }
@@ -162,7 +163,7 @@ mod tests {
         let res = spotify.refresh_oauth_tokens();
         // Unlock webserver init so all other tests can run
         WEBSERVER_STARTED.store(true, Ordering::Relaxed);
-        assert!(res.is_none());
+        assert!(res.is_some());
     }
 
     #[test]