From 1f2d0419b4711dcac080c53c341aadbc002b92ac Mon Sep 17 00:00:00 2001 From: qwxp Date: Thu, 2 Jan 2025 15:52:58 +0330 Subject: [PATCH 1/3] upgrade axum, axum-extra and garde --- Cargo.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 714ecd2..412dabe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,13 +25,13 @@ edition = "2021" features = ["full", "aide"] [dependencies] -axum = { version = "0.7.5", default-features = false } -garde = { version = "0.20.0", optional = true } +axum = { version = "0.8", default-features = false } +garde = { version = "0.21.0", optional = true } validator = { version = "0.19.0", optional = true } validify = { version = "1.4.0", optional = true } [dependencies.axum-extra] -version = "0.9.3" +version = "0.10" default-features = false optional = true @@ -40,7 +40,7 @@ version = "0.7.0" optional = true [dependencies.axum_typed_multipart] -version = "0.13.1" +version = "0.14" optional = true [dependencies.serde] @@ -53,12 +53,12 @@ optional = true [dev-dependencies] anyhow = "1.0.87" -axum = { version = "0.7.5", features = ["macros"] } +axum = { version = "0.8", features = ["macros"] } tokio = { version = "1.34.0", features = ["full"] } reqwest = { version = "0.12.3", features = ["json", "multipart"] } serde = { version = "1.0.195", features = ["derive"] } validator = { version = "0.19.0", features = ["derive"] } -garde = { version = "0.20.0", features = ["serde", "derive"] } +garde = { version = "0.21.0", features = ["serde", "derive"] } serde_json = "1.0.108" serde_yaml = "0.9.27" quick-xml = { version = "0.36.1", features = ["serialize"] } From 99aa6e0054ac5a11831628116e188a69bbf169b9 Mon Sep 17 00:00:00 2001 From: qwxp Date: Thu, 2 Jan 2025 15:56:32 +0330 Subject: [PATCH 2/3] remove async_trait --- src/validator.rs | 5 ----- 1 file changed, 5 deletions(-) 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, From 0e924e6baf20df38037ee6868c8816a4d6bfa733 Mon Sep 17 00:00:00 2001 From: qwxp Date: Thu, 2 Jan 2025 15:56:32 +0330 Subject: [PATCH 3/3] 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,