-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't
Description
What it does
Consider this code from Zed:
pub fn append(&mut self, rope: Rope) {
// ....
self.chunks.append(rope.chunks.clone(), ());
self.check_invariants();
}
rope
is passed by value and dropped at the end of the function. I think we can eliminate the clone
and just consume rope.chunks
.
Clippy doesn't warn about this even with clippy::redundant_clones
turned on, I think because it's a more complex situation of consuming one field from a struct.
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messagesI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't