From fe4c0ae386a759e6b20d589f2c8d8e253ad58e7c Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Fri, 8 Oct 2021 16:09:44 +0200 Subject: [PATCH] Remove some `#[allow(warnings)]` (#376) These were probably added during development and then forgotten to be removed. --- src/extract/form.rs | 5 ++--- src/extract/path/mod.rs | 1 - src/routing/future.rs | 1 - src/routing/or.rs | 5 ++--- src/service/future.rs | 1 - 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/extract/form.rs b/src/extract/form.rs index fdc5564a..1edccb11 100644 --- a/src/extract/form.rs +++ b/src/extract/form.rs @@ -53,7 +53,6 @@ where { type Rejection = FormRejection; - #[allow(warnings)] async fn from_request(req: &mut RequestParts) -> Result { if req.method() == Method::GET { let query = req.uri().query().unwrap_or_default(); @@ -61,8 +60,8 @@ where .map_err(FailedToDeserializeQueryString::new::)?; Ok(Form(value)) } else { - if !has_content_type(&req, "application/x-www-form-urlencoded")? { - Err(InvalidFormContentType)?; + if !has_content_type(req, "application/x-www-form-urlencoded")? { + return Err(InvalidFormContentType.into()); } let body = take_body(req)?; diff --git a/src/extract/path/mod.rs b/src/extract/path/mod.rs index ba87cf19..c774c536 100644 --- a/src/extract/path/mod.rs +++ b/src/extract/path/mod.rs @@ -150,7 +150,6 @@ where { type Rejection = PathParamsRejection; - #[allow(warnings)] async fn from_request(req: &mut RequestParts) -> Result { let params = match req .extensions_mut() diff --git a/src/routing/future.rs b/src/routing/future.rs index 3296d344..8fc3795d 100644 --- a/src/routing/future.rs +++ b/src/routing/future.rs @@ -120,7 +120,6 @@ where { type Output = Result, S::Error>; - #[allow(warnings)] fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { loop { let mut this = self.as_mut().project(); diff --git a/src/routing/or.rs b/src/routing/or.rs index 0898f0aa..3414deee 100644 --- a/src/routing/or.rs +++ b/src/routing/or.rs @@ -31,7 +31,6 @@ fn traits() { assert_sync::>(); } -#[allow(warnings)] impl Service> for Or where A: Service, Response = Response> + Clone, @@ -46,11 +45,11 @@ where type Error = A::Error; type Future = ResponseFuture; - fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll> { + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } - fn call(&mut self, mut req: Request) -> Self::Future { + fn call(&mut self, req: Request) -> Self::Future { let original_uri = req.uri().clone(); ResponseFuture { diff --git a/src/service/future.rs b/src/service/future.rs index 37192ccd..ac734508 100644 --- a/src/service/future.rs +++ b/src/service/future.rs @@ -81,7 +81,6 @@ where { type Output = Result, S::Error>; - #[allow(warnings)] fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { let this = self.project();