Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make invalid timer states unrepresentable #818

Merged
merged 1 commit into from
Jun 15, 2024

Commits on Jun 15, 2024

  1. Make invalid timer states unrepresentable

    This refactors the internals of the `Timer`, such that it's impossible
    for different fields to contain conflicting information. This is done by
    factoring out an `ActiveAttempt` struct that only exists when there is
    an active attempt. Additionally inside it differentiates between the
    attempt having ended or not. The not ended state has a split index and
    an optional pause time, whereas the ended state has the date time of
    when the attempt ended.
    
    This does not yet touch the public API of the `Timer`. Factoring out the
    notion of an active attempt and making sure invalid states are
    unrepresentable is done so we can soon explore the possibility of
    storing an active attempt in the splits file.
    CryZe committed Jun 15, 2024
    Configuration menu
    Copy the full SHA
    c1bb8dc View commit details
    Browse the repository at this point in the history