diff --git a/axum-extra/src/lib.rs b/axum-extra/src/lib.rs index bb16461f..aeac44e8 100644 --- a/axum-extra/src/lib.rs +++ b/axum-extra/src/lib.rs @@ -40,7 +40,7 @@ #![deny(unreachable_pub, private_in_public)] #![allow(elided_lifetimes_in_paths, clippy::type_complexity)] #![forbid(unsafe_code)] -#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] #![cfg_attr(test, allow(clippy::float_cmp))] pub mod extract; diff --git a/axum-extra/src/routing/mod.rs b/axum-extra/src/routing/mod.rs index dc0b71e9..884cc484 100644 --- a/axum-extra/src/routing/mod.rs +++ b/axum-extra/src/routing/mod.rs @@ -10,11 +10,9 @@ mod typed; pub use self::resource::Resource; #[cfg(feature = "typed-routing")] -#[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] pub use axum_macros::TypedPath; #[cfg(feature = "typed-routing")] -#[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] pub use self::typed::{FirstElementIs, TypedPath}; /// Extension trait that adds additional methods to [`Router`]. @@ -51,7 +49,6 @@ pub trait RouterExt: sealed::Sealed { /// /// See [`TypedPath`] for more details and examples. #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_get(self, handler: H) -> Self where H: Handler, @@ -65,7 +62,6 @@ pub trait RouterExt: sealed::Sealed { /// /// See [`TypedPath`] for more details and examples. #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_delete(self, handler: H) -> Self where H: Handler, @@ -79,7 +75,6 @@ pub trait RouterExt: sealed::Sealed { /// /// See [`TypedPath`] for more details and examples. #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_head(self, handler: H) -> Self where H: Handler, @@ -93,7 +88,6 @@ pub trait RouterExt: sealed::Sealed { /// /// See [`TypedPath`] for more details and examples. #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_options(self, handler: H) -> Self where H: Handler, @@ -107,7 +101,6 @@ pub trait RouterExt: sealed::Sealed { /// /// See [`TypedPath`] for more details and examples. #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_patch(self, handler: H) -> Self where H: Handler, @@ -121,7 +114,6 @@ pub trait RouterExt: sealed::Sealed { /// /// See [`TypedPath`] for more details and examples. #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_post(self, handler: H) -> Self where H: Handler, @@ -135,7 +127,6 @@ pub trait RouterExt: sealed::Sealed { /// /// See [`TypedPath`] for more details and examples. #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_put(self, handler: H) -> Self where H: Handler, @@ -149,7 +140,6 @@ pub trait RouterExt: sealed::Sealed { /// /// See [`TypedPath`] for more details and examples. #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_trace(self, handler: H) -> Self where H: Handler, @@ -169,7 +159,6 @@ where } #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_get(self, handler: H) -> Self where H: Handler, @@ -180,7 +169,6 @@ where } #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_delete(self, handler: H) -> Self where H: Handler, @@ -191,7 +179,6 @@ where } #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_head(self, handler: H) -> Self where H: Handler, @@ -202,7 +189,6 @@ where } #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_options(self, handler: H) -> Self where H: Handler, @@ -213,7 +199,6 @@ where } #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_patch(self, handler: H) -> Self where H: Handler, @@ -224,7 +209,6 @@ where } #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_post(self, handler: H) -> Self where H: Handler, @@ -235,7 +219,6 @@ where } #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_put(self, handler: H) -> Self where H: Handler, @@ -246,7 +229,6 @@ where } #[cfg(feature = "typed-routing")] - #[cfg_attr(docsrs, doc(cfg(feature = "typed-routing")))] fn typed_trace(self, handler: H) -> Self where H: Handler,