rename valid to inner

This commit is contained in:
gengteng
2023-06-06 11:43:32 +08:00
parent 486e3eb93e
commit 273372d6ce

View File

@@ -106,9 +106,9 @@ where
type Rejection = ValidRejection<<T as HasValidate>::Rejection>; type Rejection = ValidRejection<<T as HasValidate>::Rejection>;
async fn from_request(req: Request<B>, state: &S) -> Result<Self, Self::Rejection> { async fn from_request(req: Request<B>, state: &S) -> Result<Self, Self::Rejection> {
let valid = T::from_request(req, state).await?; let inner = T::from_request(req, state).await?;
valid.get_validate().validate()?; inner.get_validate().validate()?;
Ok(Valid(valid)) Ok(Valid(inner))
} }
} }
@@ -124,8 +124,8 @@ where
type Rejection = ValidRejection<<T as HasValidate>::Rejection>; type Rejection = ValidRejection<<T as HasValidate>::Rejection>;
async fn from_request_parts(parts: &mut Parts, state: &S) -> Result<Self, Self::Rejection> { async fn from_request_parts(parts: &mut Parts, state: &S) -> Result<Self, Self::Rejection> {
let valid = T::from_request_parts(parts, state).await?; let inner = T::from_request_parts(parts, state).await?;
valid.get_validate().validate()?; inner.get_validate().validate()?;
Ok(Valid(valid)) Ok(Valid(inner))
} }
} }