Skip to content

Fix Timex.Duration.parse!/2 was calling parse/1 instead of parse/2 - #796

Closed
bfolkens wants to merge 1 commit into
bitwalker:mainfrom
bfolkens:fix_timex_duration_parse_ignores_parser_argument
Closed

bfolkens wants to merge 1 commit into
bitwalker:mainfrom
bfolkens:fix_timex_duration_parse_ignores_parser_argument

Conversation

@bfolkens

@bfolkens bfolkens commented Sep 5, 2026

Copy link
Copy Markdown

Summary of changes

Fixes #795

Currently, Timex.Duration.parse!/2 calls parse/1 instead of parse/2, so it ignores the parser argument. This patch just changes the call to parse/2, in order to preserve the alt parser functionality.

Checklist

  • New functions have typespecs, changed functions were updated
  • Same for documentation, including moduledocs
  • Tests were added or updated to cover changes
  • Commits were squashed into a single coherent commit
  • Notes added to CHANGELOG file which describe changes at a high-level

NOTE: Timex.Duration.parse isn't currently covered by any of the tests. I'm wondering if that was intentional or I'm missing something, or perhaps they were removed by accident? Happy to write those if needed.

@bitwalker

Copy link
Copy Markdown
Owner

Thanks for the contribution! This fix is now on main in 545f49ec as part of the Timex 4.0.0 changes.

Timex.Duration.parse!/2 now honors the supplied parser, with regression coverage for custom parser results and error handling.

Closing as superseded by that implementation.

@bitwalker bitwalker closed this Nov 3, 2026
@bfolkens
bfolkens deleted the fix_timex_duration_parse_ignores_parser_argument branch November 3, 2026 21:16
@bfolkens
bfolkens restored the fix_timex_duration_parse_ignores_parser_argument branch November 3, 2026 21:16
@bfolkens
bfolkens deleted the fix_timex_duration_parse_ignores_parser_argument branch November 3, 2026 21:17
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.

Timex.Duration.parse!/2 ignores parser argument

2 participants