Skip to content

Commit 7a25e1a

Browse files
authored
minor Exec cleanup (#54)
1 parent 8d292e1 commit 7a25e1a

File tree

4 files changed

+6
-17
lines changed

4 files changed

+6
-17
lines changed

src/client/legacy/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ impl Builder {
12851285
///
12861286
/// # Cargo Feature
12871287
///
1288-
/// Requires the `runtime` cargo feature to be enabled.
1288+
/// Requires the `tokio` cargo feature to be enabled.
12891289
#[cfg(feature = "tokio")]
12901290
#[cfg(feature = "http2")]
12911291
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
@@ -1306,7 +1306,7 @@ impl Builder {
13061306
///
13071307
/// # Cargo Feature
13081308
///
1309-
/// Requires the `runtime` cargo feature to be enabled.
1309+
/// Requires the `tokio` cargo feature to be enabled.
13101310
#[cfg(feature = "tokio")]
13111311
#[cfg(feature = "http2")]
13121312
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]
@@ -1326,7 +1326,7 @@ impl Builder {
13261326
///
13271327
/// # Cargo Feature
13281328
///
1329-
/// Requires the `runtime` cargo feature to be enabled.
1329+
/// Requires the `tokio` cargo feature to be enabled.
13301330
#[cfg(feature = "tokio")]
13311331
#[cfg(feature = "http2")]
13321332
#[cfg_attr(docsrs, doc(cfg(feature = "http2")))]

src/common/exec.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ pub(crate) type BoxSendFuture = Pin<Box<dyn Future<Output = ()> + Send>>;
1111
// Either the user provides an executor for background tasks, or we use
1212
// `tokio::spawn`.
1313
#[derive(Clone)]
14-
pub enum Exec {
15-
Default,
14+
pub(crate) enum Exec {
1615
Executor(Arc<dyn Executor<BoxSendFuture> + Send + Sync>),
1716
}
1817

@@ -31,17 +30,6 @@ impl Exec {
3130
F: Future<Output = ()> + Send + 'static,
3231
{
3332
match *self {
34-
Exec::Default => {
35-
#[cfg(feature = "tcp")]
36-
{
37-
tokio::task::spawn(fut);
38-
}
39-
#[cfg(not(feature = "tcp"))]
40-
{
41-
// If no runtime, we need an executor!
42-
panic!("executor must be set")
43-
}
44-
}
4533
Exec::Executor(ref e) => {
4634
e.execute(Box::pin(fut));
4735
}

src/common/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ macro_rules! ready {
1010
}
1111

1212
pub(crate) use ready;
13-
pub mod exec;
13+
pub(crate) mod exec;
1414
#[cfg(feature = "client")]
1515
mod lazy;
1616
pub(crate) mod rewind;

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
pub mod client;
88
mod common;
99
pub mod rt;
10+
#[cfg(feature = "server")]
1011
pub mod server;
1112

1213
mod error;

0 commit comments

Comments
 (0)