From 34646cd974f39bd074baee181b622e0450707087 Mon Sep 17 00:00:00 2001 From: Ray <111646748+Luv-Ray@users.noreply.github.com> Date: Thu, 24 Aug 2023 21:36:22 +0800 Subject: [PATCH] Update web-server.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用了Duration::from_secs(5),需要增加对Duration的引入 --- src/advance/async/web-server.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/advance/async/web-server.md b/src/advance/async/web-server.md index 88d704a9..a76dedd1 100644 --- a/src/advance/async/web-server.md +++ b/src/advance/async/web-server.md @@ -134,6 +134,7 @@ async fn main() { **上面的代码虽然已经是异步的,实际上它还无法并发**,原因我们后面会解释,先来模拟一下慢请求: ```rust +use std::time::Duration; use async_std::task; async fn handle_connection(mut stream: TcpStream) {