When possible std::time::Duration was preferred in place of chrono::Duration.
If there was a duration or timestamp comparison that looked like negative Durations could be in play chrono::Duration was left. (In future chrono versions they've renamed chrono::Duration to chrono::TimeDelta with the thinking that Duration implies only positive time.)
There are also some tests with chrono::Duration is left in because the constructors added readability.
There's a current nightly only feature that will add some of these constructors to std::time::Durationhttps://github.com/rust-lang/rust/issues/120301
.u(hhhh)nwrap()???
In an attempt to make default duration settings easier to understand, I used humantime::format_duration which returns a result. These are only used in serde default functions.
Bring Durations and DateTimes into alignment across settings. Companion Ops PR: https://github.com/novalabsxyz/ops/pull/1348
A Bit about
Duration
When possible
std::time::Duration
was preferred in place ofchrono::Duration
.If there was a duration or timestamp comparison that looked like negative Durations could be in play
chrono::Duration
was left. (In future chrono versions they've renamedchrono::Duration
tochrono::TimeDelta
with the thinking thatDuration
implies only positive time.)There are also some tests with
chrono::Duration
is left in because the constructors added readability. There's a current nightly only feature that will add some of these constructors tostd::time::Duration
https://github.com/rust-lang/rust/issues/120301.u(hhhh)nwrap()
???In an attempt to make default duration settings easier to understand, I used
humantime::format_duration
which returns a result. These are only used in serde default functions.