update to 0.5.0

This commit is contained in:
gengteng
2023-08-04 18:50:02 +08:00
parent f3f0171e72
commit d95e04b4d4
19 changed files with 836 additions and 292 deletions

View File

@@ -1,21 +1,13 @@
//! # Implementation of the `HasValidate` trait for the `Path` extractor.
//!
use crate::{HasValidate, ValidRejection};
use axum::extract::rejection::PathRejection;
use crate::HasValidate;
use axum::extract::Path;
use validator::Validate;
impl<T: Validate> HasValidate for Path<T> {
type Validate = T;
type Rejection = PathRejection;
fn get_validate(&self) -> &T {
&self.0
}
}
impl From<PathRejection> for ValidRejection<PathRejection> {
fn from(value: PathRejection) -> Self {
Self::Inner(value)
}
}