rust-lang/rust-clippy

`or_fun_call` isn't always a performance lint

Open

#8,574 建立於 2022年3月22日

在 GitHub 查看
 (11 留言) (0 反應) (0 負責人)Rust (1,391 fork)batch import
A-categoryL-nurserygood first issue

倉庫指標

Star
 (10,406 star)
PR 合併指標
 (平均合併 19天 22小時) (30 天內合併 113 個 PR)

描述

Replacing .unwrap_or(Vec::new()) with .unwrap_or_default() doesn't do anything for performance, they produce identical machine code with optimizations: https://rust.godbolt.org/z/hzTdazGqW.

Perhaps the lint category could be changed or it could be changed to not detect cases where it's not actually a performance warning?

貢獻者指南