From a76fc23b756748ee904707e471ec38701605c519 Mon Sep 17 00:00:00 2001 From: Shunpoco Date: Wed, 24 Sep 2025 22:51:57 +0100 Subject: [PATCH] tutorial: remove unnecessary mut the runtime instance doesn't need to be a mutable. I also modify text around since the code is not a expanded result of the async main function. --- content/tokio/tutorial/hello-tokio.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/tokio/tutorial/hello-tokio.md b/content/tokio/tutorial/hello-tokio.md index 72ff89e1..cd9d3c15 100644 --- a/content/tokio/tutorial/hello-tokio.md +++ b/content/tokio/tutorial/hello-tokio.md @@ -210,7 +210,7 @@ The `#[tokio::main]` function is a macro. It transforms the `async fn main()` into a synchronous `fn main()` that initializes a runtime instance and executes the async main function. -For example, the following: +For example, the following code: ```rust #[tokio::main] @@ -219,11 +219,11 @@ async fn main() { } ``` -gets transformed into: +is functionally equivalent to: ```rust fn main() { - let mut rt = tokio::runtime::Runtime::new().unwrap(); + let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { println!("hello"); })