-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
refactor(rust): Apply clippy:assigning_clones
lint
#14999
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
warning: assigning the result of `ToOwned::to_owned()` may be inefficient --> crates/polars-core/src/chunked_array/ops/append.rs:7:9 | 7 | *chunks = other.to_owned(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_into()`: `other.clone_into(chunks)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones = note: `-W clippy::assigning-clones` implied by `-W clippy::perf` = help: to override `-W clippy::perf` add `#[allow(clippy::assigning_clones)]` warning: assigning the result of `Clone::clone()` may be inefficient --> crates/polars-core/src/chunked_array/logical/mod.rs:47:9 | 47 | new.2 = self.2.clone(); | ^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `new.2.clone_from(&self.2)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones warning: assigning the result of `Clone::clone()` may be inefficient --> crates/polars-core/src/frame/mod.rs:936:13 | 936 | self.columns = other.columns.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `self.columns.clone_from(&other.columns)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones warning: `polars-plan` (lib) generated 6 warnings warning: assigning the result of `Clone::clone()` may be inefficient --> crates/polars-pipe/src/executors/sinks/group_by/aggregates/first.rs:58:13 | 58 | self.first = other.first.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `self.first.clone_from(&other.first)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones = note: `-W clippy::assigning-clones` implied by `-W clippy::perf` = help: to override `-W clippy::perf` add `#[allow(clippy::assigning_clones)]` warning: assigning the result of `Clone::clone()` may be inefficient --> crates/polars-pipe/src/executors/sinks/group_by/aggregates/last.rs:55:13 | 55 | self.last = other.last.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `self.last.clone_from(&other.last)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones warning: `polars-pipe` (lib) generated 2 warnings (run `cargo clippy --fix --lib -p polars-pipe` to apply 2 suggestions) warning: assigning the result of `Clone::clone()` may be inefficient --> crates/polars-lazy/src/frame/mod.rs:1945:9 | 1945 | self.left_on = on.clone(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `clone_from()`: `self.left_on.clone_from(&on)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones = note: `-W clippy::assigning-clones` implied by `-W clippy::perf` = help: to override `-W clippy::perf` add `#[allow(clippy::assigning_clones)]`
jqnatividad
requested review from
ritchie46,
stinodego,
orlp and
c-peters
as code owners
March 12, 2024 03:09
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14999 +/- ##
=======================================
Coverage 80.98% 80.99%
=======================================
Files 1333 1333
Lines 173174 173174
Branches 2458 2458
=======================================
+ Hits 140252 140254 +2
+ Misses 32454 32452 -2
Partials 468 468 ☔ View full report in Codecov by Sentry. |
stinodego
changed the title
clippy:assigning_clones
refactor(rust): Apply Mar 12, 2024
clippy:assigning_clones
lint
github-actions
bot
added
internal
An internal refactor or improvement
rust
Related to Rust Polars
labels
Mar 12, 2024
ritchie46
approved these changes
Mar 12, 2024
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!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
warning: assigning the result of
ToOwned::to_owned()
may be inefficient--> crates/polars-core/src/chunked_array/ops/append.rs:7:9
|
7 | *chunks = other.to_owned();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use
clone_into()
:other.clone_into(chunks)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note:
-W clippy::assigning-clones
implied by-W clippy::perf
= help: to override
-W clippy::perf
add#[allow(clippy::assigning_clones)]
warning: assigning the result of
Clone::clone()
may be inefficient--> crates/polars-core/src/chunked_array/logical/mod.rs:47:9
|
47 | new.2 = self.2.clone();
| ^^^^^^^^^^^^^^^^^^^^^^ help: use
clone_from()
:new.2.clone_from(&self.2)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
warning: assigning the result of
Clone::clone()
may be inefficient--> crates/polars-core/src/frame/mod.rs:936:13
|
936 | self.columns = other.columns.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use
clone_from()
:self.columns.clone_from(&other.columns)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
warning:
polars-plan
(lib) generated 6 warningswarning: assigning the result of
Clone::clone()
may be inefficient--> crates/polars-pipe/src/executors/sinks/group_by/aggregates/first.rs:58:13
|
58 | self.first = other.first.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use
clone_from()
:self.first.clone_from(&other.first)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note:
-W clippy::assigning-clones
implied by-W clippy::perf
= help: to override
-W clippy::perf
add#[allow(clippy::assigning_clones)]
warning: assigning the result of
Clone::clone()
may be inefficient--> crates/polars-pipe/src/executors/sinks/group_by/aggregates/last.rs:55:13
|
55 | self.last = other.last.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use
clone_from()
:self.last.clone_from(&other.last)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
warning:
polars-pipe
(lib) generated 2 warnings (runcargo clippy --fix --lib -p polars-pipe
to apply 2 suggestions) warning: assigning the result ofClone::clone()
may be inefficient--> crates/polars-lazy/src/frame/mod.rs:1945:9
|
1945 | self.left_on = on.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use
clone_from()
:self.left_on.clone_from(&on)
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assigning_clones
= note:
-W clippy::assigning-clones
implied by-W clippy::perf
= help: to override
-W clippy::perf
add#[allow(clippy::assigning_clones)]