summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Scott <sam@osohq.com>2020-12-06 21:54:44 -0500
committerSam Scott <sam@osohq.com>2020-12-06 21:54:44 -0500
commit7dc1b7c86749cbbe50a308e73469659232d9a3bb (patch)
treef5c4f440b0acae16012ff5372f39b5ff5aac8092 /src
parent5ec5d0989476dbae1e1fdb82ba52a39f54d8f7e7 (diff)
Add support for actix 3.
Diffstat (limited to 'src')
-rw-r--r--src/actix.rs19
-rw-r--r--src/lib.rs4
2 files changed, 18 insertions, 5 deletions
diff --git a/src/actix.rs b/src/actix.rs
index 3c0b0ca..d29d6c9 100644
--- a/src/actix.rs
+++ b/src/actix.rs
@@ -5,6 +5,11 @@
use crate::de::Config as QsConfig;
use crate::error::Error as QsError;
+#[cfg(feature = "actix")]
+use actix_web;
+#[cfg(feature = "actix2")]
+use actix_web2 as actix_web;
+
use actix_web::dev::Payload;
use actix_web::{Error as ActixError, FromRequest, HttpRequest, HttpResponse, ResponseError};
use futures::future::{ready, Ready};
@@ -26,8 +31,11 @@ impl ResponseError for QsError {
/// ## Example
///
/// ```rust
-/// #[macro_use] extern crate serde_derive;
-/// extern crate actix_web;
+/// # #[macro_use] extern crate serde_derive;
+/// # #[cfg(feature = "actix")]
+/// # use actix_web;
+/// # #[cfg(feature = "actix2")]
+/// # use actix_web2 as actix_web;
/// use actix_web::{web, App, HttpResponse};
/// use serde_qs::actix::QsQuery;
///
@@ -121,8 +129,11 @@ where
/// Query extractor configuration
///
/// ```rust
-/// #[macro_use] extern crate serde_derive;
-/// extern crate actix_web;
+/// # #[macro_use] extern crate serde_derive;
+/// # #[cfg(feature = "actix")]
+/// # use actix_web;
+/// # #[cfg(feature = "actix2")]
+/// # use actix_web2 as actix_web;
/// use actix_web::{error, web, App, FromRequest, HttpResponse};
/// use serde_qs::actix::QsQuery;
/// use serde_qs::Config as QsConfig;
diff --git a/src/lib.rs b/src/lib.rs
index 7bf11ba..bad68e9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -157,6 +157,8 @@
//! Ok(format!("Welcome {}!", info.username))
//! }
//! ```
+//!
+//! Support for `actix-web 2.0.0` is available via the `actix2` feature.
#![allow()]
#![deny(
@@ -205,7 +207,7 @@
#[macro_use]
extern crate serde;
-#[cfg(feature = "actix")]
+#[cfg(any(feature = "actix", feature = "actix2"))]
pub mod actix;
mod de;
mod error;