rust-lang/rust-clippy

`or_fun_call` isn't always a performance lint

Open

#8,574 opened on 2022年3月22日

GitHub で見る
 (11 comments) (0 reactions) (0 assignees)Rust (1,391 forks)batch import
A-categoryL-nurserygood first issue

Repository metrics

Stars
 (10,406 stars)
PR merge metrics
 (平均マージ 19d 22h) (30d で 113 merged PRs)

説明

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?

コントリビューターガイド