Closed pitdicker closed 6 months ago
Attention: Patch coverage is 75.00000%
with 4 lines
in your changes are missing coverage. Please review.
Project coverage is 91.82%. Comparing base (
3adfd88
) to head (e8db5cd
).
Files | Patch % | Lines |
---|---|---|
src/offset/mod.rs | 73.33% | 4 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR on its own doesn't look well-motivated...
Not sure what you mean. Maybe as another motivation: to implement addition and substraction for a CalendarDuration
(#1282) months and days should be added in localtime with a MappedLocalTime
as result. Then seconds should be added using a method such as this so the type remains a MappedLocalTime
.
But I have to admit I'm not sure if the current two uses in this PR for the 0.4 versions will remain useful for 0.5 with one of the plans in 1448#issuecomment-1987220921. So the method is pub(crate)
for now.
Ah, sorry, I missed that there are sort of two users for the new method. Looks a little surprising because one of the callers did not previously have the extensive logic implemented in the method.
Yes, that was the issue I set out to fix :smile:. Sorry for not saying so better.
Passing on one error in
unix::Cache::offset
requires a match that is very similar to the one inTimeZone::from_local_datetime
. I addedMappedLocalTime::try_map
that returnsMappedLocalTime::None
that can be used in both places.For the 0.5.x branch it will be easy to convert this method to return a
Result
instead.