Skip to content

Commit

Permalink
impl IntoResponseParts for () (#2471)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpdrsn committed Dec 30, 2023
1 parent 7ea7e9f commit 85573e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion axum-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

# Unreleased

- None.
- **added:** Implement `IntoResponseParts` for `()` ([#2471])

[#2471]: https://github.com/tokio-rs/axum/pull/2471

# 0.4.2 (29. December, 2023)

Expand Down
8 changes: 8 additions & 0 deletions axum-core/src/response/into_response_parts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,3 +258,11 @@ impl IntoResponseParts for Extensions {
Ok(res)
}
}

impl IntoResponseParts for () {
type Error = Infallible;

fn into_response_parts(self, res: ResponseParts) -> Result<ResponseParts, Self::Error> {
Ok(res)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ error[E0277]: the trait bound `bool: IntoResponse` is not satisfied
axum::extract::rejection::FailedToBufferBody
axum::extract::rejection::LengthLimitError
axum::extract::rejection::UnknownBodyError
axum::extract::rejection::InvalidUtf8
bytes::bytes_mut::BytesMut
and $N others
note: required by a bound in `__axum_macros_check_handler_into_response::{closure#0}::check`
--> tests/debug_handler/fail/wrong_return_type.rs:4:23
Expand Down

0 comments on commit 85573e0

Please sign in to comment.