This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| time (source) | dependencies | patch | ^0.3.16
-> ^0.3.29
|
Release Notes
time-rs/time (time)
Compare Source
Added
-
Niche value optimization for Date
has been added. Both Date
and Option<Date>
are four bytes.
-
Unit conversions have been added. It is now possible to write Second::per(Day)
, which returns
the number of seconds in one day. See the types in the [time::convert
module][time::convert module] for more
information.
Changed
- The diagnostic for
--cfg unsound_local_offset
has been removed.
#![feature(no_coverage)]
was previously used internally for code coverage. It is no longer used,
so it has been removed.
- The default value for
modifier::OffsetHour
has been changed. This was unintentionally changed in
v0.3.17 and went unnoticed until now. The sign is now only present if needed by default, as was
the case previously. This does not affect any situation where format_description!
or
format_description::parse
is used.
Fixed
- Adding or subtracting a
std::time::Duration
to/from an OffsetDateTime
will not result in
integer overflow internally. It will still panic if the result is out of range.
Compare Source
Added
- More additional constants for the well-known
Iso8601
format description have been added. This
avoids the need to manually configure the format.
- An
[end]
component has been added. This is ignored during formatting, but is used to indicate
the end of input when parsing. If any input remains after this component, an error is returned.
This is useful when using the [first]
component, as it avoids the need to reorder variants.
Changed
- The exemption for MacOS introduced in 0.3.20 has been removed. This is because some supported
versions of MacOS do not meet the requirements for the exemption.
- The
UnexpectedTrailingCharacters
error variant has been moved to ParseFromDescription
. All
previously-existing locations of this variant have been deprecated and will no longer be returned.
Compare Source
This sets the serde
dependency requirement to >= 1.0.184
where the binaries have been removed.
Compare Source
This release contains only a single change. serde
is required to be a version prior to 1.0.171.
This is due to the decision by the maintainer of serde
to include pre-built binaries that are
executed without the end user's knowledge. As of the time of publishing, the included binary has not
even been reproduced. This is a security risk, and the time
project strongly opposes this
decision. While this may break some users' builds due to conflicting versions, it is a necessary
step to ensure the security.
Compare Source
Fixed
- Methods such as
Time::replace_milliseconds
would panic on some out-of-range values. This has
been fixed.
Compare Source
Added
- The
subsecond
component is taken into account when parsing the unix_timestamp
component. If
data is conflicting, the subsecond
value takes precedence.
- Parsing a
Time
with only the hour
component is now supported. The minute
and second
, and
subsecond
components are assumed to be zero.
Changed
- The minimum supported Rust version is now 1.67.0.
- The debug output for
Parsed
has been improved.
- When parsing, invalid values are now rejected sooner. Previously, the entire input would be parsed
before being rejected in the final step. Now, invalid values are rejected as soon as they are
encountered. This affects the error variant returned, which may cause minor breakage for any code
(incorrectly) relying on the exact error variant.
- When parsing a
Time
, an error is returned if components are present but not consecutive. For
example, if hours
and seconds
are present, minutes
will not be assumed to be zero.
Fixed
- The implementation of
Duration::checked_div
could return a slightly incorrect result in some
cases. This has been fixed.
Compare Source
Added
Date::next_occurrence
Date::prev_occurrence
Date::nth_next_occurrence
Date::nth_prev_occurrence
Weekday::nth_prev
Month::nth_next
Month::nth_prev
Changed
The minimum supported Rust version policy has been updated. See the README for
details.
Fixed
Duration::abs
correctly returns Duration::MAX
when near the minimum value. The nanoseconds
value was previously incorrect.
- Compliance with ISO 8601 has been improved. Previously, a UTC offset would be incorrectly rejected
in some cases.
Compare Source
Added
OffsetDateTime::checked_to_offset
Compare Source
Added
- Any formattable/parsable type can now be used with the
time::serde::format_description!
macro.
Weekday::nth_next
Changed
- The minimum supported Rust version is now 1.65.0.
Compare Source
Changed
- The minimum supported Rust version is now 1.63.0.
- On Unix-based operating systems with known thread-safe environments, functions obtaining the local
offset no longer require a check that the program is single-threaded. This currently includes
MacOS, illumos, and NetBSD.
Added
[ignore]
component in format descriptions. A count
modifier is required, indicating the number
of bytes to ignore when parsing.
[unix_timestamp]
component in format descriptions. This is currently only usable with
OffsetDateTime
. Users can choose between seconds, milliseconds, microseconds, and nanoseconds,
and whether the sign is mandatory or optional.
Fixed
- The API for declaring soundness now uses stricter atomic orderings internally.
Compare Source
Fixed
This includes the update to the format_description!
macro, which was supposed to be included in
0.3.18.
Compare Source
Changed
- The minimum supported Rust version is now 1.62.0.
Added
[first]
and [optional]
items can now be included in format descriptions. To parse this at
runtime, you must use the format_description::parse_owned
method.
format_description::parse_borrowed
- An API has been added to opt out of soundness checks for obtaining the local offset. This replaces
the previous, officially unsupported
RUSTFLAGS="--cfg unsound_local_offset"
. End users may call
time::util::local_offset::set_soundness(time::util::local_offset::Soundness::Unsound)
. This
method is unsafe
because it enables undefined behavior if its safety requirements are not
upheld. Note that libraries must not set this to Unsound
, as it is impossible for a library
to guarantee end users uphold the required invariants.
Fixed
- Correctly parse offset sign when hour is zero. The parse was previously unconditionally positive,
even if the sign indicated otherwise.
- Compilation is fixed for WebAssembly.
Compare Source
Changed
- The amount of code generated by
time::serde::format_description!
is reduced if not all feature
flags are active.
cargo test --tests
works with any configuration of feature flags. This occurs by spawning a
subprocess that passes --all-features
. cargo test --doc
works with most combinations of
feature flags, including the default. The combination of these changes means that crater will now
run on time
.
libc
and num_threads
are only included as dependencies when needed. They were previously
unconditionally included.
Added
time::format_description::parse_owned
, which returns an OwnedFormatItem
. This avoids "lifetime
hell", where all your structs now need a lifetime because a single field has one. Note that when
possible, the borrowed format item (just called FormatItem
) is still preferred, as it has
significantly fewer allocations. The new OwnedFormatItem
is usable for both formatting and
parsing, as you would expect.
Compatibility
- The parser for runtime format descriptions has been rewritten. A side effect of this is that some
errors have slightly changed. No existing API has been altered, so this is not a breaking change.
However, you may notice different errors, which are hopefully better! The parser for compile-time
format descriptions has not yet been swapped out. If you notice any bugs, please file an issue.
Configuration
π
Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
π¦ Automerge: Disabled by config. Please merge this manually once you are satisfied.
β» Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
π Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.