diff --git a/axum/src/handler/mod.rs b/axum/src/handler/mod.rs index 8485390bbf..4821fe1873 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 b6e1357c51..abee97baf0 100644 --- a/axum/src/middleware/from_fn.rs +++ b/axum/src/middleware/from_fn.rs @@ -345,8 +345,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 e4c1c397ba..2510cdc256 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 03e2bd6b90..30492c388c 100644 --- a/axum/src/routing/route.rs +++ b/axum/src/routing/route.rs @@ -230,8 +230,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 9da67fc1f8..8bad2acd49 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 fbb4c3b067..697f31a557 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() {