Repository: actix/actix (language: rust)

Issue:
Decouple actix-http dependency
There is circular dependency: actix -> actix-http -> actix-web -> actix , which makes it hard to update versions. This crate depends on actix-http only because of 2 implementations:

 - https://github.com/actix/actix/blob/ba9f0a374462b80374ab9ecf5956c4a1265e7a87/src/lib.rs#L208
 - https://github.com/actix/actix/blob/ba9f0a374462b80374ab9ecf5956c4a1265e7a87/src/actors/resolver.rs#L151

What about moving those implementations to actix-http crate and remove actix dependency on actix-http breaking the loop.


Discussion / hints:

Fix patch:
diff --git a/CHANGES.md b/CHANGES.md
index b61bbb799..726090dc4 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,5 +1,11 @@
 # CHANGES
 
+## [NEXT]
+
+### Changed
+
+* Feature `http` was removed. Actix support for http was moved solely to actix-http and actix-web crates.
+
 ## [0.9.1] 2020-??-??
 
 ### Fixed
diff --git a/Cargo.toml b/Cargo.toml
index f87f81256..5f6e405d9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,7 @@ path = "src/lib.rs"
 members = ["examples/chat"]
 
 [features]
-default = ["resolver", "http"]
+default = ["resolver"]
 
 # dns resolver
 resolver = ["trust-dns-proto", "trust-dns-resolver"]
@@ -32,9 +32,6 @@ resolver = ["trust-dns-proto", "trust-dns-resolver"]
 # Adds assertion to prevent processing too many messages on event loop
 mailbox_assert = []
 
-# actix-http support
-http = ["actix-http"]
-
 [dependencies]
 actix-rt = "1.0.0"
 actix_derive = "0.5"
@@ -51,9 +48,6 @@ parking_lot = "0.10"
 tokio = { version = "0.2.6", default-features = false, features=["rt-core", "rt-util", "io-driver", "io-util", "tcp", "uds", "udp", "time", "signal", "sync"] }
 tokio-util   = { version = "0.2", features = ["full"] }
 
-# actix-http support
-actix-http = { version = "1.0.1", optional = true }
-
 # dns resolver
 trust-dns-proto = { version = "0.19", optional = true, default-features = false, features = ["tokio-runtime"] }
 trust-dns-resolver = { version = "0.19", optional = true, default-features = false, features = ["tokio-runtime", "system-config"] }
diff --git a/src/actors/resolver.rs b/src/actors/resolver.rs
index a23d5888a..923854f7b 100644
--- a/src/actors/resolver.rs
+++ b/src/actors/resolver.rs
@@ -141,10 +141,6 @@ pub enum ResolverError {
     IoError(io::Error),
 }
 
-/// `InternalServerError` for `actix::MailboxError`
-#[cfg(feature = "http")]
-impl actix_http::ResponseError for ResolverError {}
-
 pub struct Resolver {
     resolver: Option<AsyncResolver>,
     cfg: Option<(ResolverConfig, ResolverOpts)>,
diff --git a/src/lib.rs b/src/lib.rs
index 7eb8095d1..703893a48 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -204,7 +204,3 @@ where
 {
     actix_rt::spawn(f);
 }
-
-/// `InternalServerError` for `actix::MailboxError`
-#[cfg(feature = "http")]
-impl actix_http::ResponseError for MailboxError {}


Test patch: