Skip to content

unwrap_used lint fires for #[test]ing code #5805

Closed
@jplatte

Description

@jplatte

It would be nice if there was a lint that fired on unwraps inside regular code, but not in #[test] (or #[cfg(test)]?) code, potentially just the existing unwrap_used lint.

  • Do you think this is desireable as the default behaviour of unwrap_used or should it likely be a separate lint?
  • Would this be hard to implement (i.e. how hard is it for clippy to tell whether some code is under #[test] / #[cfg(test)]?

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesgood 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