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

treewide: appease clippy and the deprecation warnings #805

Merged
merged 2 commits into from
Sep 1, 2023

Conversation

piodul
Copy link
Collaborator

@piodul piodul commented Sep 1, 2023

This time, we've got a double whammy:

  • clippy version has been bumped up in GitHub's CI runner, which introduced new lints that are failing for our codebase,
  • New version of chrono has been released which deprecates DateTime::from_utc.

This PR addresses both of the issues, making the CI green again.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

Very recently, a new version of `chrono` have been released (`0.4.27`)
which deprecates the `DateTime::from_utc` function. As we treat
deprecation warnings as errors, this started to cause the CI to fail.
This commit replaces the use of this function
with `DateTime::from_naive_utc_and_offset`.
Clippy started to suggest using arrays instead of `vec!` where
applicable, i.e. if the vector would be converted to an iterator anyway,
then we can get rid of an allocation by replacing it with an array. This
is only an issue with a small number of tests and it's easy to fix, so
this commit just applies clippy's suggestions.
@piodul piodul requested a review from cvybhu September 1, 2023 05:16
@piodul piodul merged commit 220c354 into scylladb:main Sep 1, 2023
8 checks passed
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.

2 participants