diff --git a/src/client/legacy/client.rs b/src/client/legacy/client.rs index cde7a6d..91a6ca3 100644 --- a/src/client/legacy/client.rs +++ b/src/client/legacy/client.rs @@ -1285,7 +1285,7 @@ impl Builder { /// /// # Cargo Feature /// - /// Requires the `runtime` cargo feature to be enabled. + /// Requires the `tokio` cargo feature to be enabled. #[cfg(feature = "tokio")] #[cfg(feature = "http2")] #[cfg_attr(docsrs, doc(cfg(feature = "http2")))] @@ -1306,7 +1306,7 @@ impl Builder { /// /// # Cargo Feature /// - /// Requires the `runtime` cargo feature to be enabled. + /// Requires the `tokio` cargo feature to be enabled. #[cfg(feature = "tokio")] #[cfg(feature = "http2")] #[cfg_attr(docsrs, doc(cfg(feature = "http2")))] @@ -1326,7 +1326,7 @@ impl Builder { /// /// # Cargo Feature /// - /// Requires the `runtime` cargo feature to be enabled. + /// Requires the `tokio` cargo feature to be enabled. #[cfg(feature = "tokio")] #[cfg(feature = "http2")] #[cfg_attr(docsrs, doc(cfg(feature = "http2")))] diff --git a/src/common/exec.rs b/src/common/exec.rs index 2f23dad..40860ee 100644 --- a/src/common/exec.rs +++ b/src/common/exec.rs @@ -11,8 +11,7 @@ pub(crate) type BoxSendFuture = Pin + Send>>; // Either the user provides an executor for background tasks, or we use // `tokio::spawn`. #[derive(Clone)] -pub enum Exec { - Default, +pub(crate) enum Exec { Executor(Arc + Send + Sync>), } @@ -31,17 +30,6 @@ impl Exec { F: Future + Send + 'static, { match *self { - Exec::Default => { - #[cfg(feature = "tcp")] - { - tokio::task::spawn(fut); - } - #[cfg(not(feature = "tcp"))] - { - // If no runtime, we need an executor! - panic!("executor must be set") - } - } Exec::Executor(ref e) => { e.execute(Box::pin(fut)); } diff --git a/src/common/mod.rs b/src/common/mod.rs index e370dfc..160df72 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -10,7 +10,7 @@ macro_rules! ready { } pub(crate) use ready; -pub mod exec; +pub(crate) mod exec; #[cfg(feature = "client")] mod lazy; pub(crate) mod rewind; diff --git a/src/lib.rs b/src/lib.rs index 85f3d3b..8fa7f26 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,6 +7,7 @@ pub mod client; mod common; pub mod rt; +#[cfg(feature = "server")] pub mod server; mod error;