Support customizing the request body type in #[debug_handler] (#595)

This commit is contained in:
David Pedersen
2021-12-08 19:37:18 +01:00
committed by GitHub
parent 4b85b227e1
commit 8895926f73
7 changed files with 64 additions and 18 deletions
-5
View File
@@ -1,5 +0,0 @@
error: unexpected token
--> tests/fail/attrs.rs:3:17
|
3 | #[debug_handler(foo)]
| ^^^
@@ -0,0 +1,5 @@
error: unknown argument
--> tests/fail/invalid_attrs.rs:3:17
|
3 | #[debug_handler(foo)]
| ^^^
@@ -0,0 +1,10 @@
use axum::{body::BoxBody, http::Request};
use axum_debug::debug_handler;
#[debug_handler(body = BoxBody)]
async fn handler(_: Request<BoxBody>) {}
#[debug_handler(body = axum::body::BoxBody,)]
async fn handler_with_trailing_comma_and_type_path(_: Request<axum::body::BoxBody>) {}
fn main() {}
+1 -4
View File
@@ -1,7 +1,4 @@
use axum::{
body::BoxBody,
response::{IntoResponse, Response},
};
use axum::response::{IntoResponse, Response};
use axum_debug::debug_handler;
struct A;