Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes uses of deprecated methods from chrono #471

Merged
merged 1 commit into from Feb 21, 2023

Conversation

zslayton
Copy link
Contributor

Starting in v0.4.23, chrono deprecated a number of methods that would panic if the parameters were out of bounds (e.g. month=400) in favor of new versions that would return a None if the inputs were bad.

This PR replaces usages of the deprecated methods with their safe counterparts. Unfortunately, the safe counterparts are rather more verbose. However, most of the impacted code was in unit tests.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov
Copy link

codecov bot commented Feb 21, 2023

Codecov Report

Base: 90.41% // Head: 90.41% // Decreases project coverage by -0.01% ⚠️

Coverage data is based on head (3178d8a) compared to base (396a973).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #471      +/-   ##
==========================================
- Coverage   90.41%   90.41%   -0.01%     
==========================================
  Files          77       77              
  Lines       14171    14177       +6     
==========================================
+ Hits        12813    12818       +5     
- Misses       1358     1359       +1     
Impacted Files Coverage Δ
src/types/timestamp.rs 92.13% <100.00%> (+0.05%) ⬆️
src/text/parsers/timestamp.rs 90.31% <0.00%> (-0.39%) ⬇️
src/text/non_blocking/raw_text_reader.rs 93.28% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@desaikd desaikd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! There are still some clippy warnings though.

@zslayton
Copy link
Contributor Author

There are still some clippy warnings though.

Most of them are being tracked in #468, one is a bug in clippy itself being tracked in #472. Thanks for the review!

@zslayton zslayton merged commit 2140858 into main Feb 21, 2023
@zslayton zslayton deleted the avoid-deprec-ts-methods branch February 21, 2023 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants