diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index f9d7ae5..e6f7cef 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -112,7 +112,7 @@ jobs: # https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability strategy: matrix: - msrv: ["1.72.1"] # Actix-web requires at least 1.72 + msrv: ["1.85.0"] # Actix-web requires at least 1.83, Rust 2024 requires 1.85 name: ubuntu / ${{ matrix.msrv }} steps: - uses: actions/checkout@v4 diff --git a/Cargo.toml b/Cargo.toml index 907d927..c3feacc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,13 +2,13 @@ name = "actix-web-validation" description = "A common validation interface for actix-web applications" version = "0.8.0" -edition = "2021" +edition = "2024" authors = ["Ross Sullivan "] repository = "https://github.com/ranger-ross/actix-web-validation" license = "MIT" # Try to match https://github.com/actix/actix-web/blob/master/Cargo.toml#L22 # Also be sure to update the README MSRV badge -rust-version = "1.72" +rust-version = "1.85" [dependencies] actix-web = "4" @@ -21,7 +21,7 @@ serde = { version = "1", features = ["derive"]} serde_json = "1" validator = { version = "0.20", features = ["derive"] } garde = { version = "0.22", features = ["derive"] } -derive_more = { version = "1", features = ["display"] } +derive_more = { version = "2", features = ["display"] } [features] diff --git a/examples/garde_custom_error_response.rs b/examples/garde_custom_error_response.rs index 3e9ab8a..fde0997 100644 --- a/examples/garde_custom_error_response.rs +++ b/examples/garde_custom_error_response.rs @@ -1,9 +1,9 @@ #![cfg(not(test))] use actix_web::{ - post, web::Json, App, HttpRequest, HttpResponse, HttpServer, Responder, ResponseError, + App, HttpRequest, HttpResponse, HttpServer, Responder, ResponseError, post, web::Json, }; -use actix_web_validation::{garde::GardeErrorHandlerExt, Validated}; +use actix_web_validation::{Validated, garde::GardeErrorHandlerExt}; use derive_more::Display; use garde::Validate; use serde::{Deserialize, Serialize}; diff --git a/examples/garde_simple.rs b/examples/garde_simple.rs index 20f10f9..453301d 100644 --- a/examples/garde_simple.rs +++ b/examples/garde_simple.rs @@ -1,6 +1,6 @@ #![cfg(not(test))] -use actix_web::{post, web::Json, App, HttpResponse, HttpServer, Responder}; +use actix_web::{App, HttpResponse, HttpServer, Responder, post, web::Json}; use actix_web_validation::garde::Validated; use garde::Validate; use serde::{Deserialize, Serialize}; diff --git a/examples/validator_custom_error_response.rs b/examples/validator_custom_error_response.rs index 4ed48cb..f0c57a5 100644 --- a/examples/validator_custom_error_response.rs +++ b/examples/validator_custom_error_response.rs @@ -1,9 +1,9 @@ #![cfg(not(test))] use actix_web::{ - post, web::Json, App, HttpRequest, HttpResponse, HttpServer, Responder, ResponseError, + App, HttpRequest, HttpResponse, HttpServer, Responder, ResponseError, post, web::Json, }; -use actix_web_validation::{validator::ValidatorErrorHandlerExt, Validated}; +use actix_web_validation::{Validated, validator::ValidatorErrorHandlerExt}; use derive_more::Display; use serde::{Deserialize, Serialize}; use std::sync::Arc; diff --git a/examples/validator_simple.rs b/examples/validator_simple.rs index 394bc6f..c37b986 100644 --- a/examples/validator_simple.rs +++ b/examples/validator_simple.rs @@ -1,6 +1,6 @@ #![cfg(not(test))] -use actix_web::{post, web::Json, App, HttpResponse, HttpServer, Responder}; +use actix_web::{App, HttpResponse, HttpServer, Responder, post, web::Json}; use actix_web_validation::Validated; use serde::{Deserialize, Serialize}; use validator::Validate; diff --git a/src/custom.rs b/src/custom.rs index 7967695..5d72c25 100644 --- a/src/custom.rs +++ b/src/custom.rs @@ -5,9 +5,9 @@ //! use crate::validated_definition; +use actix_web::FromRequest; use actix_web::dev::{ServiceFactory, ServiceRequest}; use actix_web::http::StatusCode; -use actix_web::FromRequest; use actix_web::{App, HttpRequest, HttpResponse, ResponseError}; use std::fmt::Display; use std::future::Future; @@ -32,7 +32,7 @@ impl Display for ValidationError { } } -/// A validated extactor. +/// A validated extractor. /// /// This type will run any validations on the inner extractors. /// @@ -203,7 +203,7 @@ impl ValidationErrorHandlerExt for &mut actix_web::web::ServiceConfig { mod test { use super::*; use actix_web::web::Bytes; - use actix_web::{http::header::ContentType, post, test, web::Json, App, Responder}; + use actix_web::{App, Responder, http::header::ContentType, post, test, web::Json}; use serde::{Deserialize, Serialize}; #[derive(Debug, Deserialize, Serialize)] diff --git a/src/garde.rs b/src/garde.rs index 9b802cd..ba44d64 100644 --- a/src/garde.rs +++ b/src/garde.rs @@ -16,9 +16,9 @@ use crate::validated_definition; use ::garde::Validate; +use actix_web::FromRequest; use actix_web::dev::{ServiceFactory, ServiceRequest}; use actix_web::http::StatusCode; -use actix_web::FromRequest; use actix_web::{App, HttpRequest, HttpResponse, ResponseError}; use std::fmt::Display; use std::future::Future; @@ -26,7 +26,7 @@ use std::sync::Arc; use std::{fmt::Debug, ops::Deref, pin::Pin, task::Poll}; use thiserror::Error; -/// A validated extactor. +/// A validated extractor. /// /// This type will run any validations on the inner extractors. /// @@ -190,7 +190,7 @@ impl GardeErrorHandlerExt for &mut actix_web::web::ServiceConfig { mod test { use super::*; use actix_web::web::Bytes; - use actix_web::{http::header::ContentType, post, test, web::Json, App, Responder}; + use actix_web::{App, Responder, http::header::ContentType, post, test, web::Json}; use garde::Validate; use serde::{Deserialize, Serialize}; diff --git a/src/validator.rs b/src/validator.rs index 4ca3688..7ab813f 100644 --- a/src/validator.rs +++ b/src/validator.rs @@ -16,9 +16,9 @@ use crate::validated_definition; use ::validator::Validate; +use actix_web::FromRequest; use actix_web::dev::{ServiceFactory, ServiceRequest}; use actix_web::http::StatusCode; -use actix_web::FromRequest; use actix_web::{App, HttpRequest, HttpResponse, ResponseError}; use std::fmt::Display; use std::future::Future; @@ -27,7 +27,7 @@ use std::{fmt::Debug, ops::Deref, pin::Pin, task::Poll}; use thiserror::Error; use validator::{ValidationError, ValidationErrors, ValidationErrorsKind}; -/// A validated extactor. +/// A validated extractor. /// /// This type will run any validations on the inner extractors. /// @@ -231,7 +231,7 @@ impl ValidatorErrorHandlerExt for &mut actix_web::web::ServiceConfig { mod test { use super::*; use actix_web::web::Bytes; - use actix_web::{http::header::ContentType, post, test, web::Json, App, Responder}; + use actix_web::{App, Responder, http::header::ContentType, post, test, web::Json}; use serde::{Deserialize, Serialize}; use validator::Validate;