From 2fc8d39940e3a04e0fd58a16a7329f8ee00bc3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E7=BF=B1=E7=BF=94?= Date: Thu, 16 Apr 2020 19:16:41 +0800 Subject: [PATCH] Remove unused variable _stopper --- shutdown-server/src/main.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/shutdown-server/src/main.rs b/shutdown-server/src/main.rs index 8a830ae5..f16ab51c 100644 --- a/shutdown-server/src/main.rs +++ b/shutdown-server/src/main.rs @@ -22,17 +22,14 @@ async fn main() -> std::io::Result<()> { // create a channel let (tx, rx) = mpsc::channel::<()>(); - let _stopper = tx.clone(); let bind = "127.0.0.1:8080"; // start server as normal but don't .await after .run() yet let server = HttpServer::new(move || { // give the server a Sender in .data - let stopper = tx.clone(); - App::new() - .data(stopper) + .data(tx.clone()) .wrap(middleware::Logger::default()) .service(hello) .service(stop)