Remove Task::get_ready method I added, which is unusable in practice (#22012)

Does seem like such a mechanism should be possible, but not yet sure how
to define it.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2024-12-14 03:21:41 -07:00 committed by GitHub
parent c5fe6ef100
commit 6e1cc5dad3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -67,15 +67,6 @@ impl<T> Task<T> {
Task(TaskState::Ready(Some(val)))
}
/// Returns the task's result if it is already know. The only known usecase for this is for
/// skipping spawning another task that awaits on this one.
pub fn get_ready(self) -> Option<T> {
match self {
Task(TaskState::Ready(val)) => val,
Task(TaskState::Spawned(_)) => None,
}
}
/// Detaching a task runs it to completion in the background
pub fn detach(self) {
match self {