Skip to content

Commit

Permalink
refactor(common): move common feature cfg in common::task to common::…
Browse files Browse the repository at this point in the history
…mod (#3492)
  • Loading branch information
tottoto committed Dec 17, 2023
1 parent d9c5d3b commit 21aa2f1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions src/common/mod.rs
Expand Up @@ -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"),
Expand Down
2 changes: 0 additions & 2 deletions 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<std::convert::Infallible> {
cx.waker().wake_by_ref();
Poll::Pending
Expand Down

0 comments on commit 21aa2f1

Please sign in to comment.