From cc11b5ad7db8ed631d8607a194546f433ba1f6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ml=C3=A1dek?= Date: Mon, 22 Sep 2025 14:18:46 +0200 Subject: [PATCH] axum-extra: gate rejection test behind feature (#3493) --- axum-extra/src/routing/typed.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/axum-extra/src/routing/typed.rs b/axum-extra/src/routing/typed.rs index f45ef053..909a0419 100644 --- a/axum-extra/src/routing/typed.rs +++ b/axum-extra/src/routing/typed.rs @@ -384,10 +384,7 @@ impl_second_element_is!(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, #[cfg(test)] mod tests { - use crate::{ - extract::WithRejection, - routing::{RouterExt, TypedPath}, - }; + use crate::routing::{RouterExt, TypedPath}; use axum::{ extract::rejection::PathRejection, response::{IntoResponse, Response}, @@ -441,9 +438,10 @@ mod tests { assert_eq!(uri, "/users/1?&foo=foo&bar=123&baz=true&qux=1337"); } + #[cfg(feature = "with-rejection")] #[allow(dead_code)] // just needs to compile fn supports_with_rejection() { - async fn handler(_: WithRejection) {} + async fn handler(_: crate::extract::WithRejection) {} struct MyRejection {}