From 5845b3965cb346c7969e93f4b531c6bff8d90dd0 Mon Sep 17 00:00:00 2001 From: Alex Rebert Date: Mon, 22 Feb 2021 07:00:08 -0500 Subject: [PATCH] actix-http-test: minimize features of dependencies (#2019) --- actix-http-test/Cargo.toml | 4 ++-- actix-http/src/error.rs | 1 + actix-http/src/response.rs | 8 ++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/actix-http-test/Cargo.toml b/actix-http-test/Cargo.toml index 6dcf73637..8ec073661 100644 --- a/actix-http-test/Cargo.toml +++ b/actix-http-test/Cargo.toml @@ -35,7 +35,7 @@ actix-tls = "3.0.0-beta.3" actix-utils = "3.0.0-beta.2" actix-rt = "2" actix-server = "2.0.0-beta.3" -awc = "3.0.0-beta.2" +awc = { version = "3.0.0-beta.2", default-features = false } base64 = "0.13" bytes = "1" @@ -57,5 +57,5 @@ features = ["vendored"] optional = true [dev-dependencies] -actix-web = "4.0.0-beta.3" +actix-web = { version = "4.0.0-beta.3", default-features = false, features = ["cookies"] } actix-http = "3.0.0-beta.3" diff --git a/actix-http/src/error.rs b/actix-http/src/error.rs index 97f2b3eff..d3095e68d 100644 --- a/actix-http/src/error.rs +++ b/actix-http/src/error.rs @@ -983,6 +983,7 @@ mod tests { assert_eq!(resp.status(), StatusCode::INTERNAL_SERVER_ERROR); } + #[cfg(feature = "cookies")] #[test] fn test_cookie_parse() { let resp: Response = CookieParseError::EmptyName.error_response(); diff --git a/actix-http/src/response.rs b/actix-http/src/response.rs index 471dacd28..f96f8f9b6 100644 --- a/actix-http/src/response.rs +++ b/actix-http/src/response.rs @@ -896,8 +896,9 @@ mod tests { use super::*; use crate::body::Body; - use crate::http::header::{HeaderValue, CONTENT_TYPE, COOKIE, SET_COOKIE}; - use crate::HttpMessage; + use crate::http::header::{HeaderValue, CONTENT_TYPE, COOKIE}; + #[cfg(feature = "cookies")] + use crate::{http::header::SET_COOKIE, HttpMessage}; #[test] fn test_debug() { @@ -909,6 +910,7 @@ mod tests { assert!(dbg.contains("Response")); } + #[cfg(feature = "cookies")] #[test] fn test_response_cookies() { let req = crate::test::TestRequest::default() @@ -946,6 +948,7 @@ mod tests { ); } + #[cfg(feature = "cookies")] #[test] fn test_update_response_cookies() { let mut r = Response::Ok() @@ -1097,6 +1100,7 @@ mod tests { assert_eq!(resp.body().get_ref(), b"test"); } + #[cfg(feature = "cookies")] #[test] fn test_into_builder() { let mut resp: Response = "test".into();