Skip to content

refactor: migrate humantime to jiff#4616

Merged
jdx merged 3 commits into
jdx:mainfrom
risu729:migrate-humantime-to-jiff
Mar 12, 2025
Merged

refactor: migrate humantime to jiff#4616
jdx merged 3 commits into
jdx:mainfrom
risu729:migrate-humantime-to-jiff

Conversation

@risu729

@risu729 risu729 commented Mar 12, 2025

Copy link
Copy Markdown
Contributor

Follow up of #4612. humantime crate is now outdated, so migrate to jiff instead as cargo-deny suggests.

jiff is almost compatible with humantime, but is not 100% compatible as documented.
https://docs.rs/jiff/latest/jiff/fmt/friendly/index.html#comparison-with-the-humantime-crate
Notably, 1M is parsed as 1 month by humantime but cannot be parsed by jiff.

I used 2025-01-01 when converting Span to SignedDuration since we need a relative date to convert months or years, in which the duration differs depending on dates.
https://docs.rs/jiff/latest/jiff/struct.Span.html#integration-with-stdtimeduration-and-signedduration

@jdx jdx merged commit 157c79b into jdx:main Mar 12, 2025
@risu729 risu729 deleted the migrate-humantime-to-jiff branch March 13, 2025 02:05
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