Skip to content

Commit

Permalink
Remove Task::get_ready method I added, which is unusable in practice (
Browse files Browse the repository at this point in the history
zed-industries#22012)

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

Release Notes:

- N/A
  • Loading branch information
mgsloan authored Dec 14, 2024
1 parent c5fe6ef commit 6e1cc5d
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions crates/gpui/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6e1cc5d

Please sign in to comment.