4

Improve `unwrap_or_else_default` when handling `unwrap_or_else(XXX::new)` by pmn...

 8 months ago
source link: https://github.com/rust-lang/rust-clippy/pull/8163
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Copy link

Contributor

pmnoxx commented 24 days ago

edited by xFrednet

changelog: change unwrap_or_else_default to work with std constructors like Vec::new, HashSet::new, HashMap::new.

Notes:

  • Code to handle detecting those constructors is already there. I moved it out to is_default_equivalent_call

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK