You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when running clippy it suggests to change a snippet which will result in non-compilation. It suggests that removing a clone is a better choice because the value is not consumed or mutated, and yet if the clone is removed the code won;t compile as the value is actually being mutated.
I expected to see this happen:
The clone is necessary, clippy should not suggest anything.
Instead, this happened:
warning: redundant clone
--> crates/fse/src/classifier/classifier_rbf.rs:319:18
|
319 | let mut p = r.clone();
| ^^^^^^^^ help: remove this
|
note: cloned value is neither consumed nor mutated
--> crates/fse/src/classifier/classifier_rbf.rs:319:17
|
319 | let mut p = r.clone();
| ^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_clone
= note: `#[warn(clippy::redundant_clone)]` on by default
You can clearly see both p and r mutate over the algorithm.
Summary
when running clippy it suggests to change a snippet which will result in non-compilation. It suggests that removing a clone is a better choice because the value is not consumed or mutated, and yet if the clone is removed the code won;t compile as the value is actually being mutated.
Reproducer
I tried this code:
I expected to see this happen:
The clone is necessary, clippy should not suggest anything.
Instead, this happened:
You can clearly see both
p
andr
mutate over the algorithm.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: