Replace `PrimitiveDateTime` with `PlainDateTime` (time crate modernization)

While working on the gigasecond exercise, I noticed that the stub and test files (tests/gigasecond.rs) rely on time::PrimitiveDateTime.

According to the time crate documentation, PrimitiveDateTime is now an alias for PlainDateTime and will be removed in the next breaking release.

I was going to submit a PR to update gigasecond to use PlainDateTime, but I wanted to check in with the maintainers first:

  1. Does the current time = "0.3" version locked in the rust-test-runner support PlainDateTime?
  2. If yes, would you prefer a PR that updates just gigasecond, or a track-wide PR to sweep for all usages of PrimitiveDateTime (e.g., in other exercises)?

Happy to open the PR once I know the preferred scope!

1 Like

Thanks for the report.

The versions in the test runner are bumped monthly, the current one is 0.3.55, which is the latest. So yes, PlainDateTime is supported.

Gigasecond is the only exercise that uses PrimitiveDateTime, so nothing else needs to be updated. Feel free to open a PR. It will get auto-closed, but I will reopen it.

PS: Sorry for the late response, I stopped receiving emails from the forum for some reason.

1 Like

Made the PR myself: gigasecond: use PlainDateTime by senekor · Pull Request #2176 · exercism/rust · GitHub

1 Like