-
Notifications
You must be signed in to change notification settings - Fork 2k
Enhance mem_replace_with_default with other constructors #6562
Copy link
Copy link
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
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
Type
Fields
Give feedbackNo fields configured for issues without a type.
mem_replace_with_defaultcould recognize std library constructors that are equivalent toDefault::default()such asVec::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())