From 84f58ae9a5f1893ceeb2b9f485f052fde29b0b44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20Tam=C3=A1s?= Date: Sun, 18 Sep 2022 19:46:04 +0200 Subject: [PATCH] expose FromRequest and FromRequestParts macros in axum (#1352) --- axum/CHANGELOG.md | 7 +++++++ axum/src/extract/mod.rs | 3 +++ 2 files changed, 10 insertions(+) diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index cf520f88..ceb6f404 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -42,6 +42,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 without any routes will now result in a panic. Previously, this just did nothing. [#1327] +## Extractors + +- **added:** `FromRequest` and `FromRequestParts` derive macro re-exports from [`axum-macros`] behind the `macros` feature ([#1352]) + +[`axum-macros`]: https://docs.rs/axum-macros/latest/axum_macros/ +[#1352]: https://github.com/tokio-rs/axum/pull/1352 + ## Middleware - **added**: Add `middleware::from_fn_with_state` and diff --git a/axum/src/extract/mod.rs b/axum/src/extract/mod.rs index 76e780b2..c6e8bf53 100644 --- a/axum/src/extract/mod.rs +++ b/axum/src/extract/mod.rs @@ -18,6 +18,9 @@ mod state; #[doc(inline)] pub use axum_core::extract::{DefaultBodyLimit, FromRef, FromRequest, FromRequestParts}; +#[cfg(feature = "macros")] +pub use axum_macros::{FromRequest, FromRequestParts}; + #[doc(inline)] #[allow(deprecated)] pub use self::{