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())
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())