From 6930b0c975b1625b6ea1ad829efc0bca8a7f106b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8C=AB=E8=8B=87?= Date: Sat, 5 Aug 2023 10:05:08 +0800 Subject: [PATCH] Update ch20-02-multithreaded.md (#139) --- src/ch20-02-multithreaded.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ch20-02-multithreaded.md b/src/ch20-02-multithreaded.md index 5383e37..78bcd0e 100644 --- a/src/ch20-02-multithreaded.md +++ b/src/ch20-02-multithreaded.md @@ -25,12 +25,12 @@ fn handle_connection(mut stream: TcpStream) { let sleep = b"GET /sleep HTTP/1.1\r\n"; let (status_line, filename) = if buffer.starts_with(get) { - ("HTTP/1.1 200 OK\r\n\r\n", "hello.html") + ("HTTP/1.1 200 OK", "hello.html") } else if buffer.starts_with(sleep) { thread::sleep(Duration::from_secs(5)); - ("HTTP/1.1 200 OK\r\n\r\n", "hello.html") + ("HTTP/1.1 200 OK", "hello.html") } else { - ("HTTP/1.1 404 NOT FOUND\r\n\r\n", "404.html") + ("HTTP/1.1 404 NOT FOUND", "404.html") }; // --snip-- @@ -151,7 +151,7 @@ error: aborting due to previous error 文件名: src/lib.rs -```rust +```rust,no_run pub struct ThreadPool; ``` @@ -181,7 +181,7 @@ error[E0599]: no function or associated item named `new` found for type 文件夹: src/lib.rs -```rust +```rust,no_run pub struct ThreadPool; impl ThreadPool {