diff --git a/examples/echo.rs b/examples/echo.rs index d0303cf15a..93b620c6d5 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::