Skip to content

Commit

Permalink
Inline Task::yielded()
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Lai authored and jefftt committed Jul 12, 2023
1 parent 21996cb commit 03d4160
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions tokio-console/src/state/tasks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,6 @@ impl Task {
.unwrap_or_default()
}

pub(crate) fn yielded(&self) -> bool {
self.total_polls() > 1
}

/// Returns the total number of times the task has been polled.
pub(crate) fn total_polls(&self) -> u64 {
self.stats.polls
Expand Down
2 changes: 1 addition & 1 deletion tokio-console/src/warnings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl Warn<Task> for NeverYielded {
return false;
}

if task.yielded() {
if task.total_polls() > 1 {
return false;
}

Expand Down

0 comments on commit 03d4160

Please sign in to comment.