From d5ce34d3010dc9fd987a730b67c876157c19b18a Mon Sep 17 00:00:00 2001 From: Jimmy Cuadra Date: Wed, 12 Jun 2019 13:16:52 -0700 Subject: [PATCH] Address clippy warnings. --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 98dcbed8..6ba07852 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,7 +29,6 @@ clippy::needless_continue, clippy::single_match_else, clippy::unicode_not_nfc, - clippy::use_self, clippy::used_underscore_binding, clippy::wrong_pub_self_convention, clippy::wrong_self_convention @@ -88,6 +87,7 @@ impl Display for Error { impl StdError for Error {} +/// Internal representation of errors. #[derive(Debug)] pub(crate) enum InnerError { /// An HTTP error. @@ -256,7 +256,7 @@ mod tests { impl TryFrom>> for Request { type Error = Error; - fn try_from(request: HttpRequest>) -> Result { + fn try_from(request: HttpRequest>) -> Result { let request_body: RequestBody = ::serde_json::from_slice(request.body().as_slice())?; let path_segments: Vec<&str> = request.uri().path()[1..].split('/').collect(); @@ -286,7 +286,7 @@ mod tests { if http_response.status().is_success() { ok(Response) } else { - err(http_response.status().clone().into()) + err(http_response.status().into()) } } } @@ -297,7 +297,7 @@ mod tests { fn try_from(_response: Response) -> Result>, Self::Error> { let response = HttpResponse::builder() .header(CONTENT_TYPE, "application/json") - .body("{}".as_bytes().to_vec()) + .body(b"{}".to_vec()) .unwrap(); Ok(response) }