rust-lang/rust-clippy

`or_fun_call` isn't always a performance lint

Open

#8 574 ouverte le 22 mars 2022

Voir sur GitHub
 (11 commentaires) (0 réactions) (0 assignés)Rust (1 391 forks)batch import
A-categoryL-nurserygood first issue

Métriques du dépôt

Stars
 (10 406 stars)
Métriques de merge PR
 (Merge moyen 19j 22h) (113 PRs mergées en 30 j)

Description

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?

Guide contributeur