Skip to content

Commit

Permalink
[cmd] Deprecate Command.schedule()
Browse files Browse the repository at this point in the history
It's a footgun and syntactic sugar over the CommandScheduler's schedule method. We don't need syntactic sugar for a footgun.
  • Loading branch information
Gold856 committed Sep 17, 2024
1 parent cea8684 commit 717f82e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,12 @@ public WrapperCommand handleInterrupt(Runnable handler) {
});
}

/** Schedules this command. */
/**
* Schedules this command.
*
* @deprecated Use CommandScheduler.getInstance().schedule(Command...) instead
*/
@Deprecated(since = "2025", forRemoval = true)
public void schedule() {
CommandScheduler.getInstance().schedule(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,10 @@ class Command : public wpi::Sendable, public wpi::SendableHelper<Command> {

/**
* Schedules this command.
*
* @deprecated Use CommandScheduler::GetInstance().Schedule() instead
*/
[[deprecated("Use CommandScheduler::GetInstance().Schedule() instead.")]]
void Schedule();

/**
Expand Down

0 comments on commit 717f82e

Please sign in to comment.