diff --git a/listings/ch21-web-server/listing-21-10/src/main.rs b/listings/ch21-web-server/listing-21-10/src/main.rs index 81b36562af..ea6dbb3b5d 100644 --- a/listings/ch21-web-server/listing-21-10/src/main.rs +++ b/listings/ch21-web-server/listing-21-10/src/main.rs @@ -28,7 +28,7 @@ fn handle_connection(mut stream: TcpStream) { let request_line = buf_reader.lines().next().unwrap().unwrap(); // ANCHOR: here - let (status_line, filename) = match &request_line[..] { + let (status_line, filename) = match request_line.as_str() { "GET / HTTP/1.1" => ("HTTP/1.1 200 OK", "hello.html"), "GET /sleep HTTP/1.1" => { thread::sleep(Duration::from_secs(5));