From 3e888638e533efb73ed465790e3f7c856b87837e Mon Sep 17 00:00:00 2001 From: timvisee Date: Mon, 18 May 2020 18:36:07 +0200 Subject: [PATCH] Implement clippy suggestions for Rust 1.43.1 Signed-off-by: timvisee Signed-off-by: YUAN LYU --- src/server.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/server.rs b/src/server.rs index 1914ad8..5729739 100644 --- a/src/server.rs +++ b/src/server.rs @@ -131,13 +131,10 @@ impl ClientConnection { // Send an error response for the request that gave us the error. let mut error_response = Response::new(Version::Http11, StatusCode::BadRequest); - error_response.set_body(Body::new( - format!( - "{{ \"error\": \"{}\nAll previous unanswered requests will be dropped.\" }}", - inner.to_string() - ) - .to_string(), - )); + error_response.set_body(Body::new(format!( + "{{ \"error\": \"{}\nAll previous unanswered requests will be dropped.\" }}", + inner.to_string() + ))); self.connection.enqueue_response(error_response); } Err(ConnectionError::InvalidWrite) => {