From 1e3bc6bf1a4ad24409e380f5d01a00591580b2ec Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Tue, 5 Jun 2018 12:33:14 -0700 Subject: [PATCH] chore(examples): fix echo compilation without NLL --- examples/echo.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/echo.rs b/examples/echo.rs index d0303cf1..93b620c6 100644 --- a/examples/echo.rs +++ b/examples/echo.rs @@ -21,17 +21,17 @@ fn echo(req: Request) -> BoxFut { match (req.method(), req.uri().path()) { // Serve some instructions at / - (Method::GET, "/") => { + (&Method::GET, "/") => { *response.body_mut() = Body::from("Try POSTing data to /echo"); } // Simply echo the body back to the client. - (Method::POST, "/echo") => { + (&Method::POST, "/echo") => { *response.body_mut() = req.into_body(); } // Convert to uppercase before sending back to client. - (Method::POST, "/echo/uppercase") => { + (&Method::POST, "/echo/uppercase") => { let mapping = req.into_body().map(|chunk| { chunk .iter() @@ -48,7 +48,7 @@ fn echo(req: Request) -> BoxFut { // the chunks as they arrive. So, this returns a different // future, waiting on concatenating the full body, so that // it can be reversed. Only then can we return a `Response`. - (Method::POST, "/echo/reversed") => { + (&Method::POST, "/echo/reversed") => { let reversed = req.into_body().concat2().map(move |chunk| { let body = chunk.iter().rev().cloned().collect::>(); *response.body_mut() = Body::from(body);