1
0
mirror of https://github.com/actix/examples synced 2024-11-27 16:02:57 +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 // create a channel
let (tx, rx) = mpsc::channel::<()>(); let (tx, rx) = mpsc::channel::<()>();
let _stopper = tx.clone();
let bind = "127.0.0.1:8080"; let bind = "127.0.0.1:8080";
// start server as normal but don't .await after .run() yet // start server as normal but don't .await after .run() yet
let server = HttpServer::new(move || { let server = HttpServer::new(move || {
// give the server a Sender in .data // give the server a Sender in .data
let stopper = tx.clone();
App::new() App::new()
.data(stopper) .data(tx.clone())
.wrap(middleware::Logger::default()) .wrap(middleware::Logger::default())
.service(hello) .service(hello)
.service(stop) .service(stop)