1
0
mirror of https://github.com/actix/examples synced 2024-11-23 22:41:07 +01:00

Remove unused variable _stopper

This commit is contained in:
吴翱翔 2020-04-16 19:16:41 +08:00
parent ea5df90869
commit 2fc8d39940

View File

@ -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)