From 4333a7db41af2c6fac2bd6417479b5929f2d7afa Mon Sep 17 00:00:00 2001 From: myfreax Date: Thu, 12 May 2022 16:57:10 +0800 Subject: [PATCH] Fix HashMap type must declare inside async context --- content/tokio/tutorial/spawning.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/tokio/tutorial/spawning.md b/content/tokio/tutorial/spawning.md index 6b9d4544..ec68cdb6 100644 --- a/content/tokio/tutorial/spawning.md +++ b/content/tokio/tutorial/spawning.md @@ -373,7 +373,7 @@ async fn process(socket: TcpStream) { use std::collections::HashMap; // A hashmap is used to store data - let mut db = HashMap::new(); + let mut db = HashMap::>::new(); // Connection, provided by `mini-redis`, handles parsing frames from // the socket