rust-lang/rust-clippy

`or_fun_call` isn't always a performance lint

Open

#8.574 aberto em 22 de mar. de 2022

Ver no GitHub
 (11 comments) (0 reactions) (0 assignees)Rust (1.391 forks)batch import
A-categoryL-nurserygood first issue

Métricas do repositório

Stars
 (10.406 stars)
Métricas de merge de PR
 (Mesclagem média 19d 22h) (113 fundiu PRs em 30d)

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?

Guia do colaborador