From 21aa2f1c69e1cc329b5787122c25596e0fa5e3ed Mon Sep 17 00:00:00 2001 From: tottoto Date: Sun, 17 Dec 2023 22:43:43 +0900 Subject: [PATCH] refactor(common): move common feature cfg in common::task to common::mod (#3492) --- src/common/mod.rs | 1 + src/common/task.rs | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/mod.rs b/src/common/mod.rs index 57b66e1f9f..424f9cf667 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -16,6 +16,7 @@ pub(crate) mod buf; #[cfg(all(feature = "server", any(feature = "http1", feature = "http2")))] pub(crate) mod date; pub(crate) mod io; +#[cfg(all(any(feature = "client", feature = "server"), feature = "http1"))] pub(crate) mod task; #[cfg(any( all(feature = "server", feature = "http1"), diff --git a/src/common/task.rs b/src/common/task.rs index 63b5540464..41671b1453 100644 --- a/src/common/task.rs +++ b/src/common/task.rs @@ -1,10 +1,8 @@ -#[cfg(all(any(feature = "client", feature = "server"), feature = "http1"))] use std::task::{Context, Poll}; /// A function to help "yield" a future, such that it is re-scheduled immediately. /// /// Useful for spin counts, so a future doesn't hog too much time. -#[cfg(all(any(feature = "client", feature = "server"), feature = "http1"))] pub(crate) fn yield_now(cx: &mut Context<'_>) -> Poll { cx.waker().wake_by_ref(); Poll::Pending