Skip to content

Conversation

@djc
Copy link
Member

@djc djc commented Sep 11, 2025

@djc djc requested a review from Copilot September 11, 2025 08:52
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the duration parsing code by extracting unit parsing logic into a separate enum and improving code organization. The changes focus on making the parsing logic more maintainable while preserving existing functionality.

Key changes:

  • Introduced a new Unit enum with FromStr implementation to replace string matching
  • Refactored duration accumulation logic into a standalone function
  • Reorganized method order within the Parser implementation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@djc djc force-pushed the fractional-tweaks branch from da49f65 to fbaa5c2 Compare September 11, 2025 08:54
@djc djc force-pushed the fractional-tweaks branch from fbaa5c2 to 14afe62 Compare September 11, 2025 08:57
@djc djc merged commit fc0e7ea into main Sep 11, 2025
14 checks passed
kodiakhq bot pushed a commit to pdylanross/fatigue that referenced this pull request Sep 12, 2025
Bumps humantime from 2.2.0 to 2.3.0.

Release notes
Sourced from humantime's releases.

2.3.0
What's Changed

Add 'wk', 'wks' for weeks and 'yr', 'yrs' for years by @​ryo1kato in chronotope/humantime#50
Allow parsing zero durations with no units by @​RobertGauld in chronotope/humantime#43
Use µs not us by @​RobertGauld in chronotope/humantime#45
feat: parse_duration("0") by @​aatifsyed in chronotope/humantime#55
Support fractional durations (with precision safeguards, without any new dependency) by @​TheElectronWill in chronotope/humantime#56
feat: Accept "+00:00" as an alternative way to specify the UTC timezone by @​TheElectronWill in chronotope/humantime#59
Fractional tweaks by @​djc in chronotope/humantime#60




Commits

7994b71 ci: disable for non-main pushes
1b59068 Bump version to 2.3.0
cacdb93 ci: add audit job
5cc8dc5 ci: add job to check semver compatibility
0d5fe2d Bump version to 2.2.1
fc0e7ea duration: move current value out of Parser
1febd52 duration: track current value as Duration
0adba12 duration: track current nanoseconds as u32
786218f Extract unit parsing
9ff48bf Re-order duration parser methods in top-down order
Additional commits viewable in compare view




Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

@dependabot rebase will rebase this PR
@dependabot recreate will recreate this PR, overwriting any edits that have been made to it
@dependabot merge will merge this PR after your CI passes on it
@dependabot squash and merge will squash and merge this PR after your CI passes on it
@dependabot cancel merge will cancel a previously requested merge and block automerging
@dependabot reopen will reopen this PR if it is closed
@dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
@dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
@dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
@dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants