Implement clippy suggestions for Rust 1.43.1

Signed-off-by: timvisee <tim@visee.me>
Signed-off-by: YUAN LYU <lyuyuan92@gmail.com>
This commit is contained in:
timvisee
2020-05-18 18:36:07 +02:00
committed by Adrian Catangiu
parent 2e3f629054
commit 3e888638e5

View File

@@ -131,13 +131,10 @@ impl<T: Read + Write> ClientConnection<T> {
// 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) => {