mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-25 00:00:23 +02:00
Simplify handler trait (#221)
Rely on the `impl FromRequest for (T, ...)` rather than extracting things directly inside the macro.
This commit is contained in:
@@ -191,9 +191,9 @@ fn service_handle_on_router_still_impls_routing_dsl() {
|
||||
#[test]
|
||||
fn layered() {
|
||||
let app = Router::new()
|
||||
.route("/echo", get::<_, Body, _>(unit))
|
||||
.route("/echo", get(unit))
|
||||
.layer(timeout())
|
||||
.handle_error(handle_error::<BoxError>);
|
||||
.handle_error::<Body, _>(handle_error::<BoxError>);
|
||||
|
||||
check_make_svc::<_, _, _, Infallible>(app.into_make_service());
|
||||
}
|
||||
@@ -201,9 +201,9 @@ fn layered() {
|
||||
#[tokio::test] // async because of `.boxed()`
|
||||
async fn layered_boxed() {
|
||||
let app = Router::new()
|
||||
.route("/echo", get::<_, Body, _>(unit))
|
||||
.route("/echo", get(unit))
|
||||
.layer(timeout())
|
||||
.boxed()
|
||||
.boxed::<Body, _>()
|
||||
.handle_error(handle_error::<BoxError>);
|
||||
|
||||
check_make_svc::<_, _, _, Infallible>(app.into_make_service());
|
||||
|
||||
Reference in New Issue
Block a user