-
Notifications
You must be signed in to change notification settings - Fork 1.7k
CI: add clippy::needless_pass_by_value rule
#18468
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
665c453
2736b39
f2811e9
dac1004
c66bee8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -382,6 +382,7 @@ mod tests { | |||||
| use arrow::datatypes::{DataType, SchemaBuilder}; | ||||||
| use std::sync::Arc; | ||||||
|
|
||||||
| #[allow(clippy::needless_pass_by_value)] | ||||||
|
||||||
| #[allow(clippy::needless_pass_by_value)] | |
| #[expect(clippy::needless_pass_by_value)] |
Which will error if the lint is no longer needed
allow will sit there silently even when the the lint is fixed
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.
fixed in dac1004
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.
we could change this to impl IntoIterator<Item = &str> for example
| fn create_qualified_schema(qualifier: &str, names: Vec<&str>) -> Result<DFSchema> { | |
| fn create_qualified_schema(qualifier: &str, names: impl IntoIterator<Item = &str>) -> Result<DFSchema> { |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -140,6 +140,7 @@ fn hash_array_primitive<T>( | |
| /// If `rehash==true` this combines the previous hash value in the buffer | ||
| /// with the new hash using `combine_hashes` | ||
| #[cfg(not(feature = "force_hash_collisions"))] | ||
| #[allow(clippy::needless_pass_by_value)] | ||
|
||
| fn hash_array<T>( | ||
| array: T, | ||
| random_state: &RandomState, | ||
|
|
||
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.
I think this would be better to add at the module level (rather than in the CI script) so that it would also be flagged locally when people ran clippy.
Similar to this:
datafusion/datafusion/common/src/lib.rs
Line 25 in e4f2b49
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.
I reverted the CI script, and update the
datafusion/common/cargo.tomlinstead in 2736b39, since we can update the wholedatafusion-commoncrate at once.When updating a larger crate, I think it's possible to configure like this to update module by module.