From a4a298cf88286c3ee83ce99db0032ec0c85eb87a Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Mon, 4 Jul 2022 11:10:52 +0200 Subject: [PATCH] Re-export `debug_handler` from axum (#1144) * Re-export `debug_handler` from axum Fixes #1143 * also axum-extra --- axum-macros/Cargo.toml | 2 +- axum/CHANGELOG.md | 6 +++++- axum/Cargo.toml | 2 ++ axum/src/lib.rs | 4 ++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/axum-macros/Cargo.toml b/axum-macros/Cargo.toml index af9e65ea..57850158 100644 --- a/axum-macros/Cargo.toml +++ b/axum-macros/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT" name = "axum-macros" readme = "README.md" repository = "https://github.com/tokio-rs/axum" -version = "0.2.3" +version = "0.2.3" # remember to also bump the version that axum and axum-extra depends on [lib] proc-macro = true diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index b6d10307..7a73fa9c 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -7,7 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Unreleased -- None. +- **added:** Added `debug_handler` which is an attribute macro that improves + type errors when applied to handler function. It is re-exported from + `axum-macros` ([#1144]) + +[#1144]: https://github.com/tokio-rs/axum/pull/1144 # 0.5.11 (02. July, 2022) diff --git a/axum/Cargo.toml b/axum/Cargo.toml index e6a4799c..0b64bb34 100644 --- a/axum/Cargo.toml +++ b/axum/Cargo.toml @@ -16,6 +16,7 @@ form = ["serde_urlencoded"] http1 = ["hyper/http1"] http2 = ["hyper/http2"] json = ["serde_json"] +macros = ["axum-macros"] matched-path = [] multipart = ["multer"] original-uri = [] @@ -47,6 +48,7 @@ tower-layer = "0.3" tower-service = "0.3" # optional dependencies +axum-macros = { path = "../axum-macros", version = "0.2.3", optional = true } base64 = { version = "0.13", optional = true } headers = { version = "0.3.7", optional = true } multer = { version = "2.0.0", optional = true } diff --git a/axum/src/lib.rs b/axum/src/lib.rs index c5f19505..be095caa 100644 --- a/axum/src/lib.rs +++ b/axum/src/lib.rs @@ -310,6 +310,7 @@ //! `http1` | Enables hyper's `http1` feature | Yes //! `http2` | Enables hyper's `http2` feature | No //! `json` | Enables the [`Json`] type and some similar convenience functionality | Yes +//! `macros` | Enables optional utility macros | No //! `matched-path` | Enables capturing of every request's router path and the [`MatchedPath`] extractor | Yes //! `multipart` | Enables parsing `multipart/form-data` requests with [`Multipart`] | No //! `original-uri` | Enables capturing of every request's original URI and the [`OriginalUri`] extractor | Yes @@ -442,3 +443,6 @@ pub use self::form::Form; #[doc(inline)] pub use axum_core::{BoxError, Error}; + +#[cfg(feature = "macros")] +pub use axum_macros::debug_handler;