Skip to content

or_fun_call isn't always a performance lint #8574

Open
@hrxi

Description

@hrxi

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-categoryArea: Categorization of lintsL-nurseryLint: Currently in the nursery groupgood-first-issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions