add test for Garde
This commit is contained in:
@@ -40,9 +40,9 @@
|
||||
|
||||
use crate::{HasValidate, HasValidateArgs};
|
||||
use axum_extra::extract::Form;
|
||||
use validator::{Validate, ValidateArgs};
|
||||
use validator::ValidateArgs;
|
||||
|
||||
impl<T: Validate> HasValidate for Form<T> {
|
||||
impl<T> HasValidate for Form<T> {
|
||||
type Validate = T;
|
||||
fn get_validate(&self) -> &T {
|
||||
&self.0
|
||||
|
||||
@@ -42,9 +42,9 @@
|
||||
|
||||
use crate::{HasValidate, HasValidateArgs};
|
||||
use axum_extra::protobuf::Protobuf;
|
||||
use validator::{Validate, ValidateArgs};
|
||||
use validator::ValidateArgs;
|
||||
|
||||
impl<T: Validate> HasValidate for Protobuf<T> {
|
||||
impl<T> HasValidate for Protobuf<T> {
|
||||
type Validate = T;
|
||||
fn get_validate(&self) -> &T {
|
||||
&self.0
|
||||
|
||||
@@ -43,9 +43,9 @@
|
||||
|
||||
use crate::{HasValidate, HasValidateArgs};
|
||||
use axum_extra::extract::Query;
|
||||
use validator::{Validate, ValidateArgs};
|
||||
use validator::ValidateArgs;
|
||||
|
||||
impl<T: Validate> HasValidate for Query<T> {
|
||||
impl<T> HasValidate for Query<T> {
|
||||
type Validate = T;
|
||||
fn get_validate(&self) -> &T {
|
||||
&self.0
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
//! }
|
||||
//! ```
|
||||
|
||||
use crate::garde::Garde;
|
||||
use crate::{Valid, ValidEx};
|
||||
use axum_extra::routing::TypedPath;
|
||||
use std::fmt::Display;
|
||||
@@ -60,3 +61,7 @@ impl<T: TypedPath + Display> TypedPath for Valid<T> {
|
||||
impl<T: TypedPath + Display, A> TypedPath for ValidEx<T, A> {
|
||||
const PATH: &'static str = T::PATH;
|
||||
}
|
||||
|
||||
impl<T: TypedPath + Display> TypedPath for Garde<T> {
|
||||
const PATH: &'static str = T::PATH;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user