In this release we shipped part of the effort to reduce the number of methods that could unexpectedly panic, notably for the DateTime and Duration types.
Chrono internally stores the value of a DateTime in UTC, and transparently converts it to the local value as required. For example adding a second to a DateTime needs to be done in UTC to get the correct result, but adding a day needs to be done in local time to be correct. What happens when the value is near the edge of the representable range, and the implicit conversions pushes it beyond the representable range? Many methods could panic on such inputs, including formatting the value for Debug output.
In chrono 0.4.32 the range of NaiveDate, NaiveDateTime and DateTime is made slightly smaller. This allows us to always do the implicit conversion, and in many cases return the expected result. Specifically the range is now from January 1, -262144 until December 31, 262143, one year less on both sides than before. We expect this may trip up tests if you hardcoded the MIN and MAX dates.
Duration had a similar issue. The range of this type was pretty arbitrary picked to match the range of an i64 in milliseconds. Negating an i64::MIN pushes a value out of range, and in the same way negating Duration::MIN could push it out of our defined range and cause a panic. This turns out to be somewhat common and hidden behind many layers of abstraction. We adjusted the type to have a minimum value of -Duration::MAX instead and prevent the panic case.
Other highlights:
Duration gained new fallible initialization methods.
Better support for rkyv.
Most methods on NaiveDateTime are now const.
We had to bump our MSRV to 1.61 to keep building with our dependencies. This will also allow us to make more methods on DateTime const in a future release.
Complete list of changes:
Fixes
Fix panic in TimeZone::from_local_datetime (#1071)
Fix out of range panics in DateTime getters and setters (#1317, #1329)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the backend-deps group in /src-tauri with 6 updates:
0.4.31
0.4.33
1.0.20
1.0.21
1.0.108
1.0.113
0.30.1
0.30.5
1.0.52
1.0.56
0.1.2
0.1.3
Updates
chrono
from 0.4.31 to 0.4.33Release notes
Sourced from chrono's releases.
... (truncated)
Commits
7c419a3
Prepare 0.4.33 releasea9b37c4
Makerkyv
feature default tosize_32
a73b543
Don't assumerkyv-(16|32|64)
implies therkyv
featureb5381f8
Fixed typo in Duration::hours() exceptionbf70419
527757386
Prepare 0.4.32 releasecee242a
Fix typos in Datelike impl for DateTime6ec8f97
Add from_timestamp_millis to DateTime<Utc> (#1374)65f0cc2
CI Linting: Fix missing sources checkout intoml
job.5536687
Add Months::as_u32() (#1373)Updates
semver
from 1.0.20 to 1.0.21Release notes
Sourced from semver's releases.
Commits
f9cc2df
Release 1.0.2187914b1
Pull in proc-macro2 sccache fixb617188
Merge pull request #309 from dtolnay/optionifletelse5481cb9
Remove option_if_let_else clippy suppressionUpdates
serde_json
from 1.0.108 to 1.0.113Release notes
Sourced from serde_json's releases.
Commits
09d865b
Release 1.0.1135aeab4e
Merge pull request #1109 from serde-rs/removeca3c2ca
Add swap_remove and shift_remove methods on Map7fece96
Release 1.0.1126a6d2bb
Merge pull request #1107 from serde-rs/unexpectedfloat83d7bad
Format f64 in error messages using ryu107c2d1
Merge pull request #1106 from serde-rs/invalidvalue62ca3e4
Handle Unexpected::Unit in Error::invalid_value296fafb
Factor out JSON-specific Display impl for serde::de::Unexpectede56cc69
Merge pull request #1105 from keienWang/masterUpdates
sysinfo
from 0.30.1 to 0.30.5Changelog
Sourced from sysinfo's changelog.
Commits
Updates
thiserror
from 1.0.52 to 1.0.56Release notes
Sourced from thiserror's releases.
Commits
77d0af4
Release 1.0.56d4caabd
Pull in proc-macro2 sccache fix6089273
Release 1.0.55322a2ae
Merge pull request #280 from dtolnay/depinfofd7d7a5
Emit dep-info for probe.rs in case sccache needs it447c328
Release 1.0.544619db8
Merge pull request #279 from dtolnay/depinfo7b53bff
Make env-dep:RUSTC_BOOTSTRAP get listed in probe's dep-infoe0500ad
Merge pull request #277 from dtolnay/nightlyci48cea47
Make CI verify that error_generic_member_access works in latest nightlyUpdates
zip-extract
from 0.1.2 to 0.1.3Commits
90fe07d
chore: Release zip-extract version 0.1.39e2479b
update dev-dependencies (dir-diff v0.3.3, tempfile v3.9.0)012ae61
update log to v0.4.20a78922f
update zip to v0.6.696a5362
fix: mirror the features of the zip crate (#15)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show