From 9a8275b45562aebea59288c36f6fc529785aeba9 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 12 Mar 2020 05:43:48 +0900 Subject: [PATCH 1/4] Minimize `futures-*` dependencies --- actix-cors/CHANGES.md | 4 ++++ actix-cors/Cargo.toml | 2 +- actix-cors/src/lib.rs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/actix-cors/CHANGES.md b/actix-cors/CHANGES.md index 8022ea4e81..17033b2ce2 100644 --- a/actix-cors/CHANGES.md +++ b/actix-cors/CHANGES.md @@ -1,5 +1,9 @@ # Changes +## [0.3.0-alpha.1] - 2020-03-11 + +* Minimize `futures-*` dependencies + ## [0.2.0] - 2019-12-20 * Release diff --git a/actix-cors/Cargo.toml b/actix-cors/Cargo.toml index c92422ddfc..efbeea9496 100644 --- a/actix-cors/Cargo.toml +++ b/actix-cors/Cargo.toml @@ -19,7 +19,7 @@ path = "src/lib.rs" actix-web = "2.0.0" actix-service = "1.0.1" derive_more = "0.99.2" -futures = "0.3.1" +futures-util = { version = "0.3.4", default-features = false } [dev-dependencies] actix-rt = "1.0.0" diff --git a/actix-cors/src/lib.rs b/actix-cors/src/lib.rs index 579a067b37..6283ce5846 100644 --- a/actix-cors/src/lib.rs +++ b/actix-cors/src/lib.rs @@ -52,7 +52,7 @@ use actix_web::http::header::{self, HeaderName, HeaderValue}; use actix_web::http::{self, Error as HttpError, Method, StatusCode, Uri}; use actix_web::HttpResponse; use derive_more::Display; -use futures::future::{ok, Either, FutureExt, LocalBoxFuture, Ready}; +use futures_util::future::{ok, Either, FutureExt, LocalBoxFuture, Ready}; /// A set of errors that can occur during processing CORS #[derive(Debug, Display)] From 405e61a603f0a2d5a72a76da46a25880b99f4a8e Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 12 Mar 2020 05:46:58 +0900 Subject: [PATCH 2/4] Update `actix-web` dependency to 3.0.0-alpha.1 --- actix-cors/CHANGES.md | 1 + actix-cors/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/actix-cors/CHANGES.md b/actix-cors/CHANGES.md index 17033b2ce2..8d2a209d07 100644 --- a/actix-cors/CHANGES.md +++ b/actix-cors/CHANGES.md @@ -3,6 +3,7 @@ ## [0.3.0-alpha.1] - 2020-03-11 * Minimize `futures-*` dependencies +* Update `actix-web` dependency to 3.0.0-alpha.1 ## [0.2.0] - 2019-12-20 diff --git a/actix-cors/Cargo.toml b/actix-cors/Cargo.toml index efbeea9496..e84c38e35d 100644 --- a/actix-cors/Cargo.toml +++ b/actix-cors/Cargo.toml @@ -16,7 +16,7 @@ name = "actix_cors" path = "src/lib.rs" [dependencies] -actix-web = "2.0.0" +actix-web = "3.0.0-alpha.1" actix-service = "1.0.1" derive_more = "0.99.2" futures-util = { version = "0.3.4", default-features = false } From 7f1680ebcfd49cbb969fa13a227874d4d263c1e2 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 12 Mar 2020 05:48:04 +0900 Subject: [PATCH 3/4] Bump up to 0.3.0-alpha.1 --- actix-cors/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actix-cors/Cargo.toml b/actix-cors/Cargo.toml index e84c38e35d..c2b461b89a 100644 --- a/actix-cors/Cargo.toml +++ b/actix-cors/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "actix-cors" -version = "0.2.0" +version = "0.3.0-alpha.1" authors = ["Nikolay Kim "] description = "Cross-origin resource sharing (CORS) for actix-web applications." readme = "README.md" From 8176d5e121c480562b836317812b6c342bb57222 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 12 Mar 2020 05:48:57 +0900 Subject: [PATCH 4/4] Run rustfmt --- actix-cors/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/actix-cors/src/lib.rs b/actix-cors/src/lib.rs index 6283ce5846..ca6cceb55d 100644 --- a/actix-cors/src/lib.rs +++ b/actix-cors/src/lib.rs @@ -776,10 +776,8 @@ where if let Some(origin) = inner.access_control_allow_origin(res.request().head()) { - res.headers_mut().insert( - header::ACCESS_CONTROL_ALLOW_ORIGIN, - origin, - ); + res.headers_mut() + .insert(header::ACCESS_CONTROL_ALLOW_ORIGIN, origin); }; if let Some(ref expose) = inner.expose_hdrs {