Skip to content

Commit

Permalink
Body: Implement From<()> (#2411)
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 authored Dec 19, 2023
1 parent f387c01 commit 212d959
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions axum-core/src/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions axum/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 212d959

Please sign in to comment.