-
Notifications
You must be signed in to change notification settings - Fork 510
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
fix clippy warnings for sources #2745
Conversation
Adopt the fixes suggested by clippy in most cases. Disable pedantic warnings for the update metadata crate after fixing several. The intent seems to have been to hold the updater code to an especially high bar, but in practice it creates a higher maintenance burden when updating Rust, and requires changes in mission-critical code for merely stylistic reasons. Signed-off-by: Ben Cressey <[email protected]>
Apply snafu annotations to box the error types most often flagged by the `clippy::result_large_err` lint, which complains whenever the Err part of a Result is greater than or equal to 128 bytes. This is most common for errors with several String fields, since each String occupies 24 bytes. That includes: * apiclient::Error * datastore::Error * tough:error::Error * handlebars::RenderError Also box a few larger types, like `semver::Version`, and use a Vec instead of an array for `PartitionSet`. Signed-off-by: Ben Cressey <[email protected]>
Signed-off-by: Ben Cressey <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A lot of files touched, but overall not too bad considering no linting was being performed before.
I tried looking through for any nuanced behavioral changes, but nothing stood out. Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
💎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, we probably want to merge this asap.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I will admit I'm unsure of the Box
ing of those errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! 🚀
Issue number:
Fixes #1776 (finally)
Description of changes:
Fix all clippy warnings for the
sources
tree, and add coverage to the CI lint checks.Testing done:
cargo make check-lints
passes for three platforms:aws-k8s-1.24
vmware-k8s-1.24
metal-k8s-1.24
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.