make clippy more happy

try-to-manage-hyper-incomplete-message
Alessandro Caprarelli 2021-10-13 17:12:57 +02:00
parent 2a0c403219
commit 4cef7492ce
1 changed files with 3 additions and 5 deletions

View File

@ -55,7 +55,7 @@ impl SimpleServer {
} }
/// Starts the TcpListener and handles the requests. /// Starts the TcpListener and handles the requests.
pub async fn start(mut self) -> () { pub async fn start(mut self) {
while let Some(stream) = self.listener.incoming().next().await { while let Some(stream) = self.listener.incoming().next().await {
match stream { match stream {
Ok(stream) => { Ok(stream) => {
@ -63,14 +63,12 @@ impl SimpleServer {
Ok(_) => (), Ok(_) => (),
Err(e) => { Err(e) => {
println!("Error handling connection: {}", e); println!("Error handling connection: {}", e);
()
} }
} }
self.calls_counter = self.calls_counter + 1; self.calls_counter += 1;
} }
Err(e) => { Err(e) => {
println!("Connection failed: {}", e); println!("Connection failed: {}", e);
()
} }
} }
} }
@ -88,7 +86,7 @@ impl SimpleServer {
let request = String::from_utf8_lossy(&buffer[..]); let request = String::from_utf8_lossy(&buffer[..]);
let request_line = request.lines().next().unwrap(); let request_line = request.lines().next().unwrap();
let response = match Self::parse_request_line(&request_line) { let response = match Self::parse_request_line(request_line) {
Ok(request) => { Ok(request) => {
println!("== Request == \n{}\n=============", request); println!("== Request == \n{}\n=============", request);
self.get_response().clone() self.get_response().clone()