From 6a8be44a0b7527d9250309258d3055bbce125328 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 16 Sep 2022 08:13:04 +0200 Subject: [PATCH] async-http: Fix unhandled warning --- async-http/src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/async-http/src/main.rs b/async-http/src/main.rs index d9e3a26..95e7f07 100644 --- a/async-http/src/main.rs +++ b/async-http/src/main.rs @@ -12,7 +12,6 @@ fn main() { // Block forever, handling each request that arrives at this IP address for stream in listener.incoming() { let stream = stream.unwrap(); - handle_connection(stream); } } @@ -20,7 +19,7 @@ fn main() { fn handle_connection(mut stream: TcpStream) { // Read the first 1024 bytes of data from the stream let mut buffer = [0; 1024]; - stream.read(&mut buffer).unwrap(); + assert!(stream.read(&mut buffer).unwrap() > 0); let get = b"GET / HTTP/1.1\r\n"; -- 2.39.5