diff --git a/docs/src/tutorial/clean_shutdown.md b/docs/src/tutorial/clean_shutdown.md index 0f54dac6..4a0c3b76 100644 --- a/docs/src/tutorial/clean_shutdown.md +++ b/docs/src/tutorial/clean_shutdown.md @@ -25,7 +25,7 @@ async fn server(addr: impl ToSocketAddrs) -> Result<()> { let listener = TcpListener::bind(addr).await?; let (broker_sender, broker_receiver) = mpsc::unbounded(); - let broker = task::spawn(broker(broker_receiver)); + let broker_handle = task::spawn(broker(broker_receiver)); let mut incoming = listener.incoming(); while let Some(stream) = incoming.next().await { let stream = stream?; @@ -33,7 +33,7 @@ async fn server(addr: impl ToSocketAddrs) -> Result<()> { spawn_and_log_error(client(broker_sender.clone(), stream)); } drop(broker_sender); // 1 - broker.await?; // 5 + broker_handle.await?; // 5 Ok(()) } ``` diff --git a/docs/src/tutorial/handling_disconnection.md b/docs/src/tutorial/handling_disconnection.md index 4cda69fd..5217a826 100644 --- a/docs/src/tutorial/handling_disconnection.md +++ b/docs/src/tutorial/handling_disconnection.md @@ -130,7 +130,7 @@ async fn server(addr: impl ToSocketAddrs) -> Result<()> { let listener = TcpListener::bind(addr).await?; let (broker_sender, broker_receiver) = mpsc::unbounded(); - let broker = task::spawn(broker(broker_receiver)); + let broker_handle = task::spawn(broker(broker_receiver)); let mut incoming = listener.incoming(); while let Some(stream) = incoming.next().await { let stream = stream?; @@ -138,7 +138,7 @@ async fn server(addr: impl ToSocketAddrs) -> Result<()> { spawn_and_log_error(client(broker_sender.clone(), stream)); } drop(broker_sender); - broker.await; + broker_handle.await; Ok(()) }