mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-27 00:00:24 +02:00
Remove B type param (#1751)
Co-authored-by: Jonas Platte <[email protected]> Co-authored-by: Michael Scofield <[email protected]>
This commit is contained in:
co-authored by
Jonas Platte
Michael Scofield
parent
9be0ea934c
commit
4e4c29175f
@@ -16,7 +16,7 @@ error[E0277]: the trait bound `bool: FromRequestParts<()>` is not satisfied
|
||||
<(T1, T2, T3, T4, T5, T6, T7) as FromRequestParts<S>>
|
||||
<(T1, T2, T3, T4, T5, T6, T7, T8) as FromRequestParts<S>>
|
||||
and 26 others
|
||||
= note: required for `bool` to implement `FromRequest<(), Body, axum_core::extract::private::ViaParts>`
|
||||
= note: required for `bool` to implement `FromRequest<(), axum_core::extract::private::ViaParts>`
|
||||
note: required by a bound in `__axum_macros_check_handler_0_from_request_check`
|
||||
--> tests/debug_handler/fail/argument_not_extractor.rs:4:23
|
||||
|
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
use axum_macros::debug_handler;
|
||||
|
||||
#[debug_handler(body = BoxBody, body = BoxBody)]
|
||||
#[debug_handler(state = (), state = ())]
|
||||
async fn handler() {}
|
||||
|
||||
#[debug_handler(state = (), state = ())]
|
||||
async fn handler_2() {}
|
||||
|
||||
fn main() {}
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
error: `body` specified more than once
|
||||
--> tests/debug_handler/fail/duplicate_args.rs:3:33
|
||||
|
|
||||
3 | #[debug_handler(body = BoxBody, body = BoxBody)]
|
||||
| ^^^^
|
||||
|
||||
error: `state` specified more than once
|
||||
--> tests/debug_handler/fail/duplicate_args.rs:6:29
|
||||
--> tests/debug_handler/fail/duplicate_args.rs:3:29
|
||||
|
|
||||
6 | #[debug_handler(state = (), state = ())]
|
||||
3 | #[debug_handler(state = (), state = ())]
|
||||
| ^^^^^
|
||||
|
||||
@@ -8,14 +8,13 @@ use axum_macros::debug_handler;
|
||||
struct A;
|
||||
|
||||
#[async_trait]
|
||||
impl<S, B> FromRequest<S, B> for A
|
||||
impl<S> FromRequest<S> for A
|
||||
where
|
||||
B: Send + 'static,
|
||||
S: Send + Sync,
|
||||
{
|
||||
type Rejection = ();
|
||||
|
||||
async fn from_request(_req: Request<B>, _state: &S) -> Result<Self, Self::Rejection> {
|
||||
async fn from_request(_req: Request<axum::body::Body>, _state: &S) -> Result<Self, Self::Rejection> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: Handlers must only take owned values
|
||||
--> tests/debug_handler/fail/extract_self_mut.rs:25:22
|
||||
--> tests/debug_handler/fail/extract_self_mut.rs:24:22
|
||||
|
|
||||
25 | async fn handler(&mut self) {}
|
||||
24 | async fn handler(&mut self) {}
|
||||
| ^^^^^^^^^
|
||||
|
||||
@@ -8,14 +8,13 @@ use axum_macros::debug_handler;
|
||||
struct A;
|
||||
|
||||
#[async_trait]
|
||||
impl<S, B> FromRequest<S, B> for A
|
||||
impl<S> FromRequest<S> for A
|
||||
where
|
||||
B: Send + 'static,
|
||||
S: Send + Sync,
|
||||
{
|
||||
type Rejection = ();
|
||||
|
||||
async fn from_request(_req: Request<B>, _state: &S) -> Result<Self, Self::Rejection> {
|
||||
async fn from_request(_req: Request<axum::body::Body>, _state: &S) -> Result<Self, Self::Rejection> {
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
error: Handlers must only take owned values
|
||||
--> tests/debug_handler/fail/extract_self_ref.rs:25:22
|
||||
--> tests/debug_handler/fail/extract_self_ref.rs:24:22
|
||||
|
|
||||
25 | async fn handler(&self) {}
|
||||
24 | async fn handler(&self) {}
|
||||
| ^^^^^
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
error: expected `body` or `state`
|
||||
error: expected `state`
|
||||
--> tests/debug_handler/fail/invalid_attrs.rs:3:17
|
||||
|
|
||||
3 | #[debug_handler(foo)]
|
||||
|
||||
@@ -15,6 +15,6 @@ error[E0277]: the trait bound `for<'de> Struct: serde::de::Deserialize<'de>` is
|
||||
(T0, T1, T2, T3)
|
||||
and $N others
|
||||
= note: required for `Struct` to implement `serde::de::DeserializeOwned`
|
||||
= note: required for `Json<Struct>` to implement `FromRequest<(), Body>`
|
||||
= note: required for `Json<Struct>` to implement `FromRequest<()>`
|
||||
= help: see issue #48214
|
||||
= help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
|
||||
|
||||
Reference in New Issue
Block a user