chore(deps): update rust crate time to v0.3.46 #100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.3.41→0.3.46Release Notes
time-rs/time (time)
v0.3.46Compare Source
Added
All possible panics are now documented for the relevant methods.
The need to use
#[serde(default)]when using customserdeformats is documented. This appliesonly when deserializing an
Option<T>.Duration::nanoseconds_i128has been made public, mirroringstd::time::Duration::from_nanos_u128.Various methods for truncating components have been added, avoiding the need to call the fallible
replacemethods multiple times.For
PrimitiveDateTime,UtcDateTime, andOffsetDateTime:truncate_to_dayFor
Time,PrimitiveDateTime,UtcDateTime, andOffsetDateTime:truncate_to_hourtruncate_to_minutetruncate_to_secondtruncate_to_millisecondtruncate_to_microsecondChanged
part of this.
error::ComponentRange, along with types that contain it, has been significantlyreduced.
Fixed
PartialOrdandOrdimplementations ofUtcOffsetnow return the expected result.v0.3.45Compare Source
Added
time::format_description::StaticFormatDescriptiontype alias for&'static [BorrowedFormatItem<'static>]. This is the type returned by thetime::macros::format_description!macro.Changed
Durationare nowconst fn.Parsedare nowconst fn.serdedependency has been replaced withserde_core, This reduces compile times by notincluding unused parts of
serde.Date::from_julian_dayuses a new algorithm, resulting in an approximately 16% performanceimprovement. This method is used internally by numerous other methods.
util::is_leap_yearuses a new algorithm, resulting in an approximately 8% performanceimprovement.
v0.3.44Compare Source
Fixed
PrimitiveDateTime,UtcDateTime, andOffsetDateTimewith differing signs (i.e.one negative and one positive year) would return the inverse result of what was expected. This was
introduced in v0.3.42 and has been fixed.
wasm-bindgenenabledserde_json.This has been fixed by explicitly specifying the type in the relevant locations.
v0.3.43Compare Source
Added
rand0.9Fixed
convertmodule, any use ofperwith types that were not the same (such asNanosecond::per(Second)) would not compile due to a bug. This has been fixed.v0.3.42Compare Source
Added
Time::duration_untilTime::duration_sinceper_tmethod for all types intime::convert. This is similar to the existingpermethod, butcan return any of the primitive numeric types that can represent the result. This will cut down on
ascasts while ensuring correctness. Type inference isn't perfect, so you may need to provide atype annotation in some situations.
impl PartialOrd for Monthandimpl Ord for Month; this assumes the months are in the same yearSystemTimeExttrait, adding methods for checked arithmetic withtime::Durationand obtainingthe difference between two
SystemTimes as atime::DurationUtcDateTimewithrand(this was inadvertently omitted previously)impl core::error::Errorfor all error types (now available when thestdfeature is disabled)thread-safe.
#[track_caller]has been added to all relevant methods.Changed
itoahas been removed, as the standard library now has similar functionalityby default.
deterministic, avoiding any subtle differences between platforms or compiler versions.
Fixed
Previously, it could be off by one nanosecond due to floating point imprecision.
OffsetDateTime::to_offsetandUtcDateTime::to_offsethas beenfixed. The bug could result in a value that was invalid. It was unlikely to ever occur in
real-world code, as it involved passing a UTC offset that has never been used in any location.
Miscellaneous
typical use cases of
format_description!.Time,PrimitiveDateTime,UtcDateTime, andOffsetDateTime. The first three have gains of approximately 85% (i.e. 6× faster).#[inline].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.
This PR was generated by Mend Renovate. View the repository job log.