Skip to content

Commit 1e3bc6b

Browse files
committed
chore(examples): fix echo compilation without NLL
1 parent 4129134 commit 1e3bc6b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/echo.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ fn echo(req: Request<Body>) -> BoxFut {
2121

2222
match (req.method(), req.uri().path()) {
2323
// Serve some instructions at /
24-
(Method::GET, "/") => {
24+
(&Method::GET, "/") => {
2525
*response.body_mut() = Body::from("Try POSTing data to /echo");
2626
}
2727

2828
// Simply echo the body back to the client.
29-
(Method::POST, "/echo") => {
29+
(&Method::POST, "/echo") => {
3030
*response.body_mut() = req.into_body();
3131
}
3232

3333
// Convert to uppercase before sending back to client.
34-
(Method::POST, "/echo/uppercase") => {
34+
(&Method::POST, "/echo/uppercase") => {
3535
let mapping = req.into_body().map(|chunk| {
3636
chunk
3737
.iter()
@@ -48,7 +48,7 @@ fn echo(req: Request<Body>) -> BoxFut {
4848
// the chunks as they arrive. So, this returns a different
4949
// future, waiting on concatenating the full body, so that
5050
// it can be reversed. Only then can we return a `Response`.
51-
(Method::POST, "/echo/reversed") => {
51+
(&Method::POST, "/echo/reversed") => {
5252
let reversed = req.into_body().concat2().map(move |chunk| {
5353
let body = chunk.iter().rev().cloned().collect::<Vec<u8>>();
5454
*response.body_mut() = Body::from(body);

0 commit comments

Comments
 (0)