Skip to content

Commit b83032a

Browse files
committed
Made it work with one move.
1 parent 1f1fc97 commit b83032a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

step02_httpserver/code/src/main.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,9 @@ async fn main() {
1414
"/quit",
1515
get({
1616
let shutdown_tx = shutdown_tx.clone();
17-
move || {
18-
let shutdown_tx = shutdown_tx.clone();
19-
async move {
20-
let _ = shutdown_tx.send(()).await;
21-
"yes i am shutting down\n"
22-
}
17+
|| async move {
18+
let _ = shutdown_tx.send(()).await;
19+
"yes i am shutting down\n"
2320
}
2421
}));
2522

0 commit comments

Comments
 (0)