mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
Implement IntoResponse for (R,) where R: IntoResponse (#2143)
This commit is contained in:
@@ -449,6 +449,16 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<R> IntoResponse for (R,)
|
||||||
|
where
|
||||||
|
R: IntoResponse,
|
||||||
|
{
|
||||||
|
fn into_response(self) -> Response {
|
||||||
|
let (res,) = self;
|
||||||
|
res.into_response()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
macro_rules! impl_into_response {
|
macro_rules! impl_into_response {
|
||||||
( $($ty:ident),* $(,)? ) => {
|
( $($ty:ident),* $(,)? ) => {
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ error[E0277]: the trait bound `bool: IntoResponse` is not satisfied
|
|||||||
&'static [u8]
|
&'static [u8]
|
||||||
&'static str
|
&'static str
|
||||||
()
|
()
|
||||||
|
(R,)
|
||||||
(Response<()>, R)
|
(Response<()>, R)
|
||||||
(Response<()>, T1, R)
|
(Response<()>, T1, R)
|
||||||
(Response<()>, T1, T2, R)
|
(Response<()>, T1, T2, R)
|
||||||
(Response<()>, T1, T2, T3, R)
|
|
||||||
and $N others
|
and $N others
|
||||||
note: required by a bound in `__axum_macros_check_handler_into_response::{closure#0}::check`
|
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
|
--> tests/debug_handler/fail/wrong_return_type.rs:4:23
|
||||||
|
|||||||
+3
-1
@@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
- None.
|
- **added:** Implement `IntoResponse` for `(R,) where R: IntoResponse` ([#2143])
|
||||||
|
|
||||||
|
[#2143]: https://github.com/tokio-rs/axum/pull/2143
|
||||||
|
|
||||||
# 0.6.20 (03. August, 2023)
|
# 0.6.20 (03. August, 2023)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user