From 0e924e6baf20df38037ee6868c8816a4d6bfa733 Mon Sep 17 00:00:00 2001 From: qwxp Date: Thu, 2 Jan 2025 15:56:32 +0330 Subject: [PATCH] remove async_trait --- src/garde.rs | 3 --- src/validator.rs | 5 ----- src/validify.rs | 9 --------- 3 files changed, 17 deletions(-) diff --git a/src/garde.rs b/src/garde.rs index d20c315..58cd504 100644 --- a/src/garde.rs +++ b/src/garde.rs @@ -9,7 +9,6 @@ pub mod test; use crate::{HasValidate, ValidationRejection}; -use axum::async_trait; use axum::extract::{FromRef, FromRequest, FromRequestParts, Request}; use axum::http::request::Parts; use garde::{Report, Validate}; @@ -77,7 +76,6 @@ impl From for GardeRejection { } } -#[async_trait] impl FromRequest for Garde where State: Send + Sync, @@ -98,7 +96,6 @@ where } } -#[async_trait] impl FromRequestParts for Garde where State: Send + Sync, diff --git a/src/validator.rs b/src/validator.rs index db36639..0531250 100644 --- a/src/validator.rs +++ b/src/validator.rs @@ -9,7 +9,6 @@ pub mod test; use crate::{HasValidate, ValidationRejection}; -use axum::async_trait; use axum::extract::{FromRef, FromRequest, FromRequestParts, Request}; use axum::http::request::Parts; use std::fmt::Display; @@ -144,7 +143,6 @@ pub trait HasValidateArgs<'v> { fn get_validate_args(&self) -> &Self::ValidateArgs; } -#[async_trait] impl FromRequest for Valid where State: Send + Sync, @@ -162,7 +160,6 @@ where } } -#[async_trait] impl FromRequestParts for Valid where State: Send + Sync, @@ -180,7 +177,6 @@ where } } -#[async_trait] impl FromRequest for ValidEx where State: Send + Sync, @@ -201,7 +197,6 @@ where } } -#[async_trait] impl FromRequestParts for ValidEx where State: Send + Sync, diff --git a/src/validify.rs b/src/validify.rs index 6ca5f5e..2712e66 100644 --- a/src/validify.rs +++ b/src/validify.rs @@ -9,7 +9,6 @@ pub mod test; use crate::{HasValidate, ValidationRejection}; -use axum::async_trait; use axum::extract::{FromRequest, FromRequestParts, Request}; use axum::http::request::Parts; use axum::response::{IntoResponse, Response}; @@ -301,7 +300,6 @@ pub trait HasValidify: Sized { fn from_validify(v: Self::Validify) -> Self; } -#[async_trait] impl FromRequest for Validated where State: Send + Sync, @@ -319,7 +317,6 @@ where } } -#[async_trait] impl FromRequestParts for Validated where State: Send + Sync, @@ -337,7 +334,6 @@ where } } -#[async_trait] impl FromRequest for Modified where State: Send + Sync, @@ -352,7 +348,6 @@ where } } -#[async_trait] impl FromRequestParts for Modified where State: Send + Sync, @@ -367,7 +362,6 @@ where } } -#[async_trait] impl FromRequest for Validified where State: Send + Sync, @@ -387,7 +381,6 @@ where } } -#[async_trait] impl FromRequestParts for Validified where State: Send + Sync, @@ -407,7 +400,6 @@ where } } -#[async_trait] impl FromRequest for ValidifiedByRef where State: Send + Sync, @@ -426,7 +418,6 @@ where } } -#[async_trait] impl FromRequestParts for ValidifiedByRef where State: Send + Sync,