Skip to content

Commit ba3f12a

Browse files
committed
[actix-web] Only support actix-web 2.0.0 from now on
As discussed in Pull Request #182 we will only support actix-web 2.0.0 from this point onwards. If you still wish to use a previous version of actix-web you'll have to pin the version.
1 parent 396df07 commit ba3f12a

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

maud/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ categories = ["template-engine"]
1212
edition = "2018"
1313

1414
[features]
15-
actix-web-2 = ["actix-web-2-dep", "futures"]
15+
actix-web = ["actix-web-dep", "futures"]
1616

1717
[dependencies]
1818
maud_htmlescape = { version = "0.17.0", path = "../maud_htmlescape" }
1919
maud_macros = { version = "0.21.0", path = "../maud_macros" }
2020
iron = { version = ">= 0.5.1, < 0.7.0", optional = true }
2121
rocket = { version = ">= 0.3, < 0.5", optional = true }
22-
actix-web = { version = "1.0.0", optional = true, default-features = false }
23-
actix-web-2-dep = { version = "2.0.0", optional = true, default-features = false, package = "actix-web" }
2422
futures = { version = "0.3.0", optional = true }
23+
actix-web-dep = { version = "2.0.0", optional = true, default-features = false, package = "actix-web" }
2524

2625
[dev-dependencies]
2726
compiletest_rs = { version = "0.3.19", features = ["stable"] }

maud/src/lib.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
1010
#![doc(html_root_url = "https://docs.rs/maud/0.21.0")]
1111

12-
#[cfg(feature = "actix-web")] extern crate actix_web;
12+
#[cfg(feature = "actix-web")] extern crate actix_web_dep;
1313
#[cfg(feature = "iron")] extern crate iron;
1414
#[cfg(feature = "rocket")] extern crate rocket;
1515

@@ -194,23 +194,7 @@ mod rocket_support {
194194
#[cfg(feature = "actix-web")]
195195
mod actix_support {
196196
use crate::PreEscaped;
197-
use actix_web::{Responder, HttpResponse, HttpRequest, Error};
198-
199-
impl Responder for PreEscaped<String> {
200-
type Error = Error;
201-
type Future = Result<HttpResponse, Self::Error>;
202-
fn respond_to(self, _req: &HttpRequest) -> Self::Future {
203-
Ok(HttpResponse::Ok()
204-
.content_type("text/html; charset=utf-8")
205-
.body(self.0))
206-
}
207-
}
208-
}
209-
210-
#[cfg(feature = "actix-web-2")]
211-
mod actix2_support {
212-
use crate::PreEscaped;
213-
use actix_web_2_dep::{Responder, HttpResponse, HttpRequest, Error};
197+
use actix_web_dep::{Responder, HttpResponse, HttpRequest, Error};
214198
use futures::future::{ok, Ready};
215199

216200
impl Responder for PreEscaped<String> {

0 commit comments

Comments
 (0)