11 comments (11 comments)0 reactions (0 reactions)0 assignees (0 assignees)Rust1,391 forks (1,391 forks)batch import
A-categoryL-nurserygood first issue
Repository metrics
- Stars
- 10,406 stars (10,406 stars)
- PR merge metrics
- Avg merge 19d 22h (Avg merge 19d 22h)113 merged PRs in 30d (113 merged PRs in 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?
Contributor guide
- Research direction
- Examine the `or fun call` lint implementation in Clippy to understand how it determines performance implications, then consider adjusting the lint category or adding exceptions for cases where the replacement yields identical machine code.
- Tech stack
- rust
- Domain
- developer experience
- Issue type
- Bug
- Prerequisites
- RustClippy internals