Skip to content

"unnecessary negation" (if-not-else) is a bit annoying #859

@birkenfeld

Description

@birkenfeld

Suppose the following case:

        if some_error_condition {
            Err(some_error)
        } else if some_other_error_condition {
            Err(some_other_error)
        } else {
            Ok(result)
        }

If some_other_error_condition happens to be a != b, the lint will trigger. However, I don't want to move the Ok case inbetween the Err cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions