-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
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'tgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
mem_replace_with_default could recognize std library constructors that are equivalent to Default::default() such as Vec::new(), HashMap::new(), etc. This may also apply to #3812 when it is implemented, and the two lints may share a list of known "default-equivalent" constructors. vec![] should also be recognized.
Example: std::mem::replace(&mut v, Vec::new())
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'tgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy