Skip to content

Disable result_unwrap_used / option_unwrap_used in tests #1015

Closed
@llogiq

Description

@llogiq

If clippy is used as a dependency, the lints can pick up test code. Since that code does not need to have full-blown error handling, unwrap is ok.

To solve this, we can use get_parent to walk up the parent chain and check all items for #[test] annotations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.L-testsLint: Lints test codeT-middleType: Probably requires verifiying types

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions