Skip to content

Commit

Permalink
Improve panic message for when a task is polled after completion (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkiFire13 committed Apr 23, 2024
1 parent 24adf39 commit 3cfa07f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ impl<T, M> Future for Task<T, M> {

fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
match self.poll_task(cx) {
Poll::Ready(t) => Poll::Ready(t.expect("task has failed")),
Poll::Ready(t) => Poll::Ready(t.expect("Task polled after completion")),
Poll::Pending => Poll::Pending,
}
}
Expand Down

0 comments on commit 3cfa07f

Please sign in to comment.