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)
Added indexing methods to raw entries: RawEntryBuilder::from_hash_full,
RawEntryBuilder::index_from_hash, and RawEntryMut::index.
2.2.1
Corrected the signature of RawOccupiedEntryMut::into_key(self) -> &'a mut K,
This a breaking change from 2.2.0, but that version was published for less
than a day and has now been yanked.
2.2.0
The new IndexMap::get_index_entry method finds an entry by its index for
in-place manipulation.
The Keys iterator now implements Index<usize> for quick access to the
entry's key, compared to indexing the map to get the value.
The new IndexMap::splice and IndexSet::splice methods will drain the
given range as an iterator, and then replace that range with entries from
an input iterator.
The new trait RawEntryApiV1 offers opt-in access to a raw entry API for
IndexMap, corresponding to the unstable API on HashSet as of Rust 1.75.
Many IndexMap and IndexSet methods have relaxed their type constraints,
e.g. removing K: Hash on methods that don't actually need to hash.
Removal methods remove, remove_entry, and take are now deprecated
in favor of their shift_ or swap_ prefixed variants, which are more
explicit about their effect on the index and order of remaining items.
The deprecated methods will remain to guide drop-in replacements from
HashMap and HashSet toward the prefixed methods.
Commits
1a50e7b Merge pull request #305 from cuviper/raw_entry-index
We are thrilled to announce the new version of ratatui - a Rust library that's all about cooking up TUIs 🐭
In this version, we made improvements on widgets such as List, Table and Layout and changed some of the defaults for a better user experience. Also, we renewed our website and updated our documentation/tutorials to get started with ratatui: https://ratatui.rs 🚀
The offset method creates a new Rect that is moved by the amount
specified in the x and y direction. These values can be positive or
negative. This is useful for manual layout tasks.
let rect = area.offset(Offset { x: 10, y -10 });
edacaf7(buffer) Deprecate Cell::symbol field (#624)
The Cell::symbol field is now accessible via a getter method (`symbol()`). This will
allow us to make future changes to the Cell internals such as replacing `String` with
We are thrilled to announce the new version of ratatui - a Rust library that's all about cooking up TUIs 🐭
In this version, we made improvements on widgets such as List, Table and Layout and changed some of the defaults for a better user experience.
Also, we renewed our website and updated our documentation/tutorials to get started with ratatui: https://ratatui.rs 🚀
The offset method creates a new Rect that is moved by the amount
specified in the x and y direction. These values can be positive or
negative. This is useful for manual layout tasks.
let rect = area.offset(Offset { x: 10, y -10 });
edacaf7(buffer) Deprecate Cell::symbol field (#624)
Bumps the deps group with 17 updates:
0.13.1
0.13.2
1.0.75
1.0.79
0.4.31
0.4.33
4.4.7
4.4.18
0.4.13
0.4.14
0.4.20
0.4.22
2.1.0
2.2.2
0.10.58
0.10.63
1.10.2
1.10.3
1.0.190
1.0.193
0.9.27
0.9.29
1.33.0
1.35.1
0.23.0
0.25.0
2.4.1
2.5.0
2.0.12
2.0.13
1.0.20
1.0.21
1.2.0
1.3.0
Updates
actix
from 0.13.1 to 0.13.2Release notes
Sourced from actix's releases.
Commits
a809645
docs: use intra-doc links in crate root9928306
chore(actix): prepare release 0.13.2fddd075
ci: standardize job names31b0f4b
ci: fix cargo-nextest install7d40ea5
ci: switch to nextestc0cf913
chore: prevent dead code warningsb555813
chore: prevent dead code warnings37b92c6
chore: prevent dead code warnings on nightly66427f9
chore: prevent dead code warning on nightly5ac0716
chore: prevent unused lint regression on nightlyUpdates
anyhow
from 1.0.75 to 1.0.79Release notes
Sourced from anyhow's releases.
Commits
71ab53d
Release 1.0.7960705a5
Merge pull request #340 from dtolnay/depinfo17e252b
Include env-dep:RUSTC_BOOTSTRAP in dep-info for sccache04774c0
Merge pull request #338 from dtolnay/nightlyci1fd290c
Make CI verify that error_generic_member_access works in latest nightlyee41470
RUSTC must be set by Cargo for build script38c79ef
Release 1.0.78ded2295
Merge pull request #337 from dtolnay/bootstrapae45b67
Do not rebuild on RUSTC_BOOTSTRAP changes on nightly compiler2d32366
Update crate name used for build script probeUpdates
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
clap
from 4.4.7 to 4.4.18Release notes
Sourced from clap's releases.
... (truncated)
Changelog
Sourced from clap's changelog.
... (truncated)
Commits
0134f45
chore: Release995ee03
docs: Update changelog2f18909
Merge pull request #5314 from epage/required0a635b9
fix(parser): Don't duplicate requireds when usage disablede648e08
Merge pull request #5311 from sourcefrog/doc-exitcode8c83971
docs: Link to exit code infob250c0b
Merge pull request #5310 from epage/ptyc742b8e
chore(complete): Update completest-ptyUpdates
globset
from 0.4.13 to 0.4.14Commits
47e3717
globset-0.4.148697946
release/doc: set date in man page9b5091b
deps: bump to memmap2 0.9.0d1def67
deps: bump pcre2 to 0.2.656af4d4
cli: add simple flag suggestions6a055d9
doc: clarify errors for -z/--search-zipe007523
doc: note the precedence of -t/--type88353c8
doc: be more explicit about ripgrep's behavior when printing to a tty9ed7565
cli: error when searching for NUL7bb9f35
doc: clarify that --pre can accept any kind of pathUpdates
ignore
from 0.4.20 to 0.4.22Commits
2c38975
ignore-0.4.22c8e4a84
cli: prefix all non-fatal error messages with 'rg: 'b9c7749
ignore: fix reference cycle for compiled matchers67dd809
ignore: add some 'allow(dead_code)' annotationse0a8567
complete/fish: improve shell completions for fish56c7ad1
ignore/types: add Lean2a4dba3
ignore/types: add meson.optionsdaa157b
core: actually implement --sortr=path0096c74
grep-0.3.18c48355
deps: bump grep-printer to 0.2.1Updates
indexmap
from 2.1.0 to 2.2.2Changelog
Sourced from indexmap's changelog.
Commits
1a50e7b
Merge pull request #305 from cuviper/raw_entry-indexf4bb006
Release 2.2.254a42ec
Add indexing methods to raw entry7264ce4
Merge pull request #304 from cuviper/raw-into_key244bd81
FixRawOccupiedEntryMut::into_key
7107c49
Merge pull request #303 from cuviper/test-updates34a7af7
Allowclippy::style
382a45c
Upgrade dev-dep itertools to 0.12904689f
ci: upgrade to actions/checkout@v4405fa10
Merge pull request #302 from cuviper/release-2.2.0Updates
openssl
from 0.10.58 to 0.10.63Release notes
Sourced from openssl's releases.
... (truncated)
Commits
cc2850f
Merge pull request #2152 from alex/bump-for-releasefde3d03
Merge pull request #2138 from zh-jq/update-boringssl1951575
Release openssl v0.10.63 and openssl-sys v0.9.99951d771
Merge pull request #2111 from trail-of-forks/pkcs7-add-apisfb57f9f
Merge pull request #2150 from alex/brainpool-on-libresslca3f45d
Expose brainpool NIDs on libressla14146f
Merge pull request #2148 from botovq/fix_stack_from_pemaa26e97
PEM parsing: check last error instead of first06143eb
Merge pull request #2145 from botovq/opaque-purposebff0db7
Make X509_PURPOSE opaque for LibreSSL >= 3.9Updates
regex
from 1.10.2 to 1.10.3Changelog
Sourced from regex's changelog.
Commits
0c09903
1.10.3653bb59
deps: bump regex-automata to 0.4.4e7b5401
regex-automata-0.4.41bc667d
changelog: 1.10.3fbd2537
safety: guard in Input::new against incorrect AsRef implementations027eebd
cargo: set 'default-features = false' for memchr and aho-corasickdc0a9d2
ci: small clean-upsa3d5975
doc: fix link in Index<&str> impl docs4f5992f
doc: tweakCaptures
documentation837fd85
regex-cli-0.2.0Updates
serde
from 1.0.190 to 1.0.193Release notes
Sourced from serde's releases.
Commits
44613c7
Release 1.0.193c706281
Merge pull request #2655 from dtolnay/rangestartend65d75b8
Add RangeFrom and RangeTo tests332b0cb
Merge pull request #2654 from dtolnay/rangestartend8c4af41
Fix more RangeFrom / RangeEnd mixups24a78f0
Merge pull request #2653 from emilbonnek/fix/range-to-from-de-mixupc91c334
Fix Range{From,To} deserialize mixup2083f43
Update ui test suite to nightly-2023-11-194676abd
Release 1.0.19235700eb
Merge pull request #2646 from robsdedude/fix/2643/allow-tag-field-in-untaggedUpdates
serde_yaml
from 0.9.27 to 0.9.29Release notes
Sourced from serde_yaml's releases.
Commits
b957d2b
Release 0.9.29007fc2d
Merge pull request #401 from dtolnay/unsafeop5bac247
Fill in unsafe blocks inside unsafe functions0f6dba1
Turn on deny(unsafe_op_in_unsafe_fn)1b6e448
Release 0.9.28ec1a314
Force unsafe-libyaml version that contains unaligned write fixa6b2dc0
Update name of blocks_in_if_conditions clippy lintUpdates
tokio
from 1.33.0 to 1.35.1Release notes
Sourced from tokio's releases.
... (truncated)
Commits
46ff363
chore: prepare Tokio v1.35.1 (#6230)0a1695e
Merge 'tokio-1.32.1' into 'tokio-1.35.x' (#6229)c4f0178
chore: prepare Tokio v1.32.1 (#6228)22b3a65
Merge 'tokio-1.25.3' into 'tokio-1.32.x' (#6227)0d36233
chore: release v1.25.3 (#6223)ab7313f
io: add budgeting to tokio::runtime::io::registration::async_io (#6221)92a3455
chore: prepare Tokio v1.35.0 (#6197)1968565
chore: use relaxed load for unsync_load (#6203)c9273f1
sync: improve safety comments forWakeList
(#6200)e05d0f8
changelog: fix missing link for 1.8.2 (#6199)Updates
ratatui
from 0.23.0 to 0.25.0Release notes
Sourced from ratatui's releases.
... (truncated)
Changelog
Sourced from ratatui's changelog.
... (truncated)
Commits
7f58848
chore(release): prepare for 0.25.0 (#699)a15c3b2
docs: remove deprecated table constructor from breaking changes (#698)41c44a4
docs(frame): add docs about resize events (#697)1b8b626
docs(examples): add animation and FPS counter to colors_rgb (#583)5bf4f52
feat: implementFrom
trait for termion toStyle
related structs (#692)f4c8de0
docs(chart): document chart module (#696)910ad00
chore(rustfmt): enable format_code_in_doc_comments (#695)b282a06
refactor!: remove items deprecated since 0.10 (#691)b8f71c0
feat(widgets/chart): add option to set the position of legend (#378)113b4b7
docs: Rename template links to remove ratatui from name 📚 (#690)Updates
url
from 2.4.1 to 2.5.0Commits
00e9e18
Update url 2.5.0 (#885)464b1f7
Fix another overflow in punycode encode_into (#880)912d716
Correct spelling mistake inPosition
docs (#875)5f454e2
Added #[must_use] Attributes for Configuration Options (#876)67fc273
Fix search setting for non-special urls with space, query and fragment (#879)ae8d29e
use checked addition to not panic in debug build (#877)e39c9a2
Fix clippy (#878)Updates
assert_cmd
from 2.0.12 to 2.0.13Changelog
Sourced from assert_cmd's changelog.
Commits
19da72b
chore: Release assert_cmd version 2.0.13db5ee32
docs: Update changelog86d96ed
chore: Update anstream8e3cb3f
Merge pull request #191 from assert-rs/renovate/github-codeql-action-3.x8159e3d
Merge pull request #190 from assert-rs/renovate/actions-setup-python-5.x48c7f1d
Looks like these dependencies are updatable in another way, so this is no longer needed.