-
Notifications
You must be signed in to change notification settings - Fork 111
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
Clippy fails because of chrono deprecation #950
Comments
Oh, it's not the only deprecation. When running CI locally I see more:
chrono has quite a lot of deprecations and other changes lately |
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
New version of chrono was released a few hours ago.
It deprecated
chrono::Duration::days
, pointing tochrono::Duration::try_days
instead.This deprecation causes our CI to fail:
https://github.com/scylladb/scylla-rust-driver/actions/runs/8178066760/job/22361165132?pr=948#step:5:398
try_days
was introduced inchrono 0.4.33
(or 0.4.32 - but docs.rs for this version don't build, so I didn't check).In order to migrate, we need to bump our
chrono
dependency to0.4.33
from the current0.4.20
- so we need to require a very recent release. I'm a bit disappointed that they deprecate stuff so quickly after introducing replacement...The alternative is to ignore this clippy error in this place, but I don't like this either.
This is the place where we use this method:
Given that this call can never fail, I'm wondering if it's better to
unwrap()
or returnValueOverflow
.I think I prefer unwrapping - panic will mean than there is an error in our code (or in the comment) which should be fixed.
Returnig
ValueOverflow
will not allow to distinguish betweenchecked_add_signed
fail andtry_days
fail.The text was updated successfully, but these errors were encountered: