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 (hyperium#3492)

Signed-off-by: Sven Pfennig <s.pfennig@reply.de>
  • Loading branch information
tottoto authored and 0xE282B0 committed Jan 16, 2024
1 parent a509d67 commit 585ec17
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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 585ec17

Please sign in to comment.