Skip to content

Rename Timer::paused to Timer::is_paused and Timer::finished to Timer::is_finished #19110

Open
@mgi388

Description

@mgi388

#15962 aligned public apis of Time, Timer and Stopwatch.

Stopwatch::paused was renamed to Stopwatch::is_paused.

But Timer::paused was left as is for some reason (couldn't find why), and also even though it calls Stopwatch::is_paused underneath:

pub fn paused(&self) -> bool {
self.stopwatch.is_paused()
}

  1. So I think we should rename Timer::paused to Timer::is_paused, leaving Timer::paused throughout 0.17, and removing it in 0.18.
  2. Similarly for Timer::finished -> Timer::is_finished.
  3. I note there is Timer::just_finished. I honestly don't know about that one. I think Timer::is_just_finished probably works and follows the rule, but I could also see Timer::just_finished continuing to make sense with just_ being its own category of predicate naming similar to names like has_ or must_.

I've left the "ready for implementation" tag off until some bike shedding can happen on item 3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-TimeInvolves time keeping and reportingC-Code-QualityA section of code that is hard to understand or changeC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-StraightforwardSimple bug fixes and API improvements, docs, test and examples

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions