mem::replace -> mem::take lint is too aggressive #5586
Labels
C-bug
Category: Clippy is not doing the correct thing
good-first-issue
These issues are a good way to get started with Clippy
I-false-positive
Issue: The lint was triggered on code it shouldn't have
S-needs-discussion
Status: Needs further discussion before merging or work can be started
Clippy will suggest replacing
with:
This is great! But it will also suggest replacing
with:
This is not great. The construction using
mem::replace
in the second case is much clearer IMO as it indicates that the function is being executed for its side effects. The construction usingmem::take
looks like a mistake.Would you folks be open to making the lint not apply in the second case?
The text was updated successfully, but these errors were encountered: