Body: Implement From<()> (#2411)

This commit is contained in:
Tobias Bieniek 2023-12-19 10:51:38 +01:00 committed by GitHub
parent f387c01f58
commit 212d959a54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -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 {

View file

@ -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