Sourced from chrono's releases.
v0.4.35
Most of our efforts have shifted to improving the API for a 0.5 release, for which cleanups and refactorings are landing on the 0.4.x branch.
The most significant changes in this release are two sets of deprecations.
We deprecated all timestamp-related methods on
NaiveDateTime. The reason is that a timestamp is defined to be in UTC. TheNaiveDateTimetype doesn't know the offset from UTC, so it was technically wrong to have these methods. The alternative is to use the similar methods on theDateTime<Utc>type, or from theTimeZonetrait.Converting from
NaiveDateTimetoDateTime<Utc>is simple with.and_utc(), and in the other direction with.naive_utc().The panicking constructors of
TimeDelta(the new name of theDurationtype) are deprecated. This was the last part of chrono that defaulted to panicking on error, dating from before rust 1.0.A nice change is that
NaiveDatenow includes a niche. So nowOption<NaiveDate>,Option<NaiveDateTime>andOption<DateTime<Tz>>are the same size as their base types.
format::Numericandformat::Fixedare marked asnon_exhaustive. This will allow us to improve our formatting and parsing support, and we have reason to believe this breaking change will have little to no impact on users.Additions
Deprecations
- Deprecate timestamp methods on
NaiveDateTime(#1473)- Deprecate panicking constructors of
TimeDelta(#1450)Changes/fixes
- Use
NonZeroI32insideNaiveDate(#1207)- Mark
format::Numericandformat::Fixedasnon_exhaustive(#1430)Parsedfixes to error values (#1439)- Use
overflowing_naive_localinDateTime::checked_add*(#1333)- Do complete range checks in
Parsed::set_*(#1465)Documentation
- Rustfmt doctests (#1452)
- Improve docs for crate features (#1455, thanks
@​edmorley)- Add more documentation and examples to
Parsed(#1439)Internal
- Refactor
internalsmodule (#1428, #1429, #1431, #1432, #1433, #1438)- CI: test cross-compiling to
x86_64-unknown-illumosinstead of Solaris (#1437)- CI: lint Windows target, fix clippy warning (#1441)
- CI: only run
cargo hack checkon Linux (#1442)- Update windows-bindgen to 0.54 (#1462, #1483)
- Simplify error value of
parse_internal(#1459)- Simplify
SerdeError(#1458)- Simplify
NaiveDate::from_isoywda bit (#1464)
... (truncated)
9fdb596
Prepare 0.4.359e667b6
Deprecate panicking TimeDelta constructors2c1b0be
Tests: replace TimeDelta::milliseconds with
try_milliseconds2bf3302
Tests: replace TimeDelta::seconds with
try_secondsf93508f
Tests: replace TimeDelta::minutes with
try_minutes9fc931a
Tests: replace TimeDelta::hours with
try_hours9f23c08
Tests: replace TimeDelta::days with
try_dayse8f9b5e
Tests: replace TimeDelta::weeks with
try_weeks51a1aa2
Tests: use Days type when it is more appropriate than
TimeDelta4251bd1
Replace TimeDelta::seconds with
try_seconds