Generate correct bound for non-last extractor in #[debug_handler] (#1299)

* Support running a single UI test

* Generate correct `FromRequestParts` bound

* don't depend on itertools
This commit is contained in:
David Pedersen
2022-08-22 15:34:17 +02:00
committed by GitHub
parent be624306f4
commit bb05dea672
9 changed files with 214 additions and 45 deletions
@@ -1,4 +1,4 @@
use axum::{async_trait, extract::FromRequest, http::Request, response::IntoResponse};
use axum::{async_trait, extract::FromRequestParts, http::request::Parts, response::IntoResponse};
use axum_macros::debug_handler;
fn main() {}
@@ -116,14 +116,13 @@ impl A {
}
#[async_trait]
impl<S, B> FromRequest<S, B> for A
impl<S> FromRequestParts<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_parts(_parts: &mut Parts, _state: &S) -> Result<Self, Self::Rejection> {
unimplemented!()
}
}