mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-25 00:00:23 +02:00
Remove B type param: Follow ups (#1789)
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
72c1b7a80c
commit
6703f8634c
@@ -6,9 +6,7 @@
|
||||
//! - Complexity: Manually implementing `FromRequest` results on more complex code
|
||||
use axum::{
|
||||
async_trait,
|
||||
body::Body,
|
||||
extract::{rejection::JsonRejection, FromRequest, MatchedPath},
|
||||
http::Request,
|
||||
extract::{rejection::JsonRejection, FromRequest, MatchedPath, Request},
|
||||
http::StatusCode,
|
||||
response::IntoResponse,
|
||||
RequestPartsExt,
|
||||
@@ -30,7 +28,7 @@ where
|
||||
{
|
||||
type Rejection = (StatusCode, axum::Json<Value>);
|
||||
|
||||
async fn from_request(req: Request<Body>, state: &S) -> Result<Self, Self::Rejection> {
|
||||
async fn from_request(req: Request, state: &S) -> Result<Self, Self::Rejection> {
|
||||
let (mut parts, body) = req.into_parts();
|
||||
|
||||
// We can use other extractors to provide better rejection messages.
|
||||
|
||||
Reference in New Issue
Block a user