feat: added clippy::needless_pass_by_value lint rule to datafusion/expr #18532
+15
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
clippy::needless_pass_by_valuetodatafusion-expr#18504.Rationale for this change
Followed suggestions to not update any public-facing APIs and put the lint rule in the appropriate spot.
What changes are included in this PR?
#![deny(clippy::needless_pass_by_value)]and#![cfg_attr(test, allow(clippy::needless_pass_by_value))]tolib.rs.#[allow(clippy::needless_pass_by_value)]to public functionsrewrite_in_terms_of_projection()andget_exprs_except_skipped()to use references per the lint suggestionAre these changes tested?
Yes, though the same test failed even without changes to the public APIs:
test expr_rewriter::order_by::test::rewrite_sort_cols_by_agg_alias ... FAILEDI'll append the logs for your convenience:
Are there any user-facing changes?
No, all modification were constrained to internal APIs.