From b30cdcfbead0be1048258cbcaf13663e5fcf9f03 Mon Sep 17 00:00:00 2001 From: Benjamin Sparks Date: Thu, 17 Oct 2024 16:47:51 +0200 Subject: [PATCH] Remove unneeded macro usage (#2995) Co-authored-by: Benjamin Sparks --- axum/src/handler/mod.rs | 2 -- axum/src/middleware/from_fn.rs | 2 -- axum/src/middleware/map_response.rs | 2 -- axum/src/routing/route.rs | 2 -- examples/serve-with-hyper/src/main.rs | 2 -- examples/unix-domain-socket/src/main.rs | 2 -- 6 files changed, 12 deletions(-) diff --git a/axum/src/handler/mod.rs b/axum/src/handler/mod.rs index 04c66c4a..783e02e3 100644 --- a/axum/src/handler/mod.rs +++ b/axum/src/handler/mod.rs @@ -328,8 +328,6 @@ where ) -> _, > = svc.oneshot(req).map(|result| match result { Ok(res) => res.into_response(), - - #[allow(unreachable_patterns)] Err(err) => match err {}, }); diff --git a/axum/src/middleware/from_fn.rs b/axum/src/middleware/from_fn.rs index f0f47611..3ed7a959 100644 --- a/axum/src/middleware/from_fn.rs +++ b/axum/src/middleware/from_fn.rs @@ -341,8 +341,6 @@ impl Next { pub async fn run(mut self, req: Request) -> Response { match self.inner.call(req).await { Ok(res) => res, - - #[allow(unreachable_patterns)] Err(err) => match err {}, } } diff --git a/axum/src/middleware/map_response.rs b/axum/src/middleware/map_response.rs index e4c1c397..2510cdc2 100644 --- a/axum/src/middleware/map_response.rs +++ b/axum/src/middleware/map_response.rs @@ -278,8 +278,6 @@ macro_rules! impl_service { Ok(res) => { f($($ty,)* res).await.into_response() } - - #[allow(unreachable_patterns)] Err(err) => match err {} } }); diff --git a/axum/src/routing/route.rs b/axum/src/routing/route.rs index 3067e675..8fc9a1d7 100644 --- a/axum/src/routing/route.rs +++ b/axum/src/routing/route.rs @@ -250,8 +250,6 @@ impl Future for InfallibleRouteFuture { fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { match futures_util::ready!(self.project().future.poll(cx)) { Ok(response) => Poll::Ready(response), - - #[allow(unreachable_patterns)] Err(err) => match err {}, } } diff --git a/examples/serve-with-hyper/src/main.rs b/examples/serve-with-hyper/src/main.rs index 9da67fc1..8bad2acd 100644 --- a/examples/serve-with-hyper/src/main.rs +++ b/examples/serve-with-hyper/src/main.rs @@ -11,8 +11,6 @@ //! //! [hyper-util]: https://crates.io/crates/hyper-util -#![allow(unreachable_patterns)] - use std::convert::Infallible; use std::net::SocketAddr; diff --git a/examples/unix-domain-socket/src/main.rs b/examples/unix-domain-socket/src/main.rs index fbb4c3b0..697f31a5 100644 --- a/examples/unix-domain-socket/src/main.rs +++ b/examples/unix-domain-socket/src/main.rs @@ -3,8 +3,6 @@ //! ```not_rust //! cargo run -p example-unix-domain-socket //! ``` -#![allow(unreachable_patterns)] - #[cfg(unix)] #[tokio::main] async fn main() {