diff --git a/axum-core/src/body.rs b/axum-core/src/body.rs index ec865184..3c3f6a10 100644 --- a/axum-core/src/body.rs +++ b/axum-core/src/body.rs @@ -84,6 +84,12 @@ impl Default for Body { } } +impl From<()> for Body { + fn from(_: ()) -> Self { + Self::empty() + } +} + macro_rules! body_from_impl { ($ty:ty) => { impl From<$ty> for Body { diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index 1ebd21d1..1eb54995 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -7,9 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Unreleased +- **added:** `Body` implements `From<()>` now ([#2411]) - **change:** Update version of multer used internally for multipart ([#2433]) - **change:** Update tokio-tungstenite to 0.21 ([#2435]) +[#2411]: https://github.com/tokio-rs/axum/pull/2411 [#2433]: https://github.com/tokio-rs/axum/pull/2433 [#2435]: https://github.com/tokio-rs/axum/pull/2435