mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-19 00:00:14 +02:00
fmt(customize-extractor-error): missing fmt
This commit is contained in:
@@ -5,10 +5,8 @@
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
extract::rejection::JsonRejection,
|
||||
http::StatusCode,
|
||||
response::IntoResponse,
|
||||
routing::post, Json, Router,
|
||||
extract::rejection::JsonRejection, http::StatusCode, response::IntoResponse, routing::post,
|
||||
Json, Router,
|
||||
};
|
||||
use axum_extra::extract::WithRejection;
|
||||
use serde::Deserialize;
|
||||
@@ -42,7 +40,7 @@ async fn handler(
|
||||
// `WithRejection` will extract `Json<User>` from the request. If the
|
||||
// extraction fails, a `MyRejection` will be created from `JsonResponse` and
|
||||
// returned to the client
|
||||
WithRejection(Json(user), _): WithRejection<Json<User>, MyRejection>
|
||||
WithRejection(Json(user), _): WithRejection<Json<User>, MyRejection>,
|
||||
) {
|
||||
dbg!(&user);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user