assigning_clones: unhelpful in test code #12752
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
I ran into a case where assigning_clones is unhelpful, and most of our test modules are going to need
#[allow(clippy::assigning_clones)]
.This occurs when a test struct is initialized with some default, and you need to assign a string to one field. This inverts the order of assignee/assignment and makes tests much harder to read, and more complicated to write.
Perhaps this check should be disabled for test code?
Lint Name
No response
Reproducer
I tried this code:
I ran
cargo clippy --all-targets
, and I saw this happen:I expected to see this happen:
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: