Skip to content

Commit

Permalink
preemption: avoid annoying warning that turns into error
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhoo committed Jan 23, 2020
1 parent bf811fb commit fad2aa9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tokio/src/league/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ pub(crate) fn ceded() {
}

/// Returns `Poll::Pending` if the current task has exceeded its budget and should yield.
#[allow(unreachable_pub)]
pub fn poll_cooperate(cx: &mut Context<'_>) -> Poll<()> {
pub(crate) fn poll_cooperate(cx: &mut Context<'_>) -> Poll<()> {
HITS.with(|hits| {
let n = hits.get();
if n == 0 {
Expand All @@ -92,8 +91,7 @@ pub fn poll_cooperate(cx: &mut Context<'_>) -> Poll<()> {
/// }
/// }
/// ```
#[allow(unreachable_pub)]
pub async fn cooperate() {
pub(crate) async fn cooperate() {
use crate::future::poll_fn;
poll_fn(|cx| poll_cooperate(cx)).await;
}

0 comments on commit fad2aa9

Please sign in to comment.