Skip to content

Merge nested matches #1252

@mcarton

Description

@mcarton

We should have a lint that suggest to change

match foo {
    Ok(row) => match row {
        Some(pixels) => pixels,
        None => return Err(),
    },
    Err(err) => return Err(),
};

into

match foo {
    Ok(Some(pixels)) => pixels,
    Ok(None) => return Err(),
    Err(...) => return Err(),
}

Copied from https://github.com/Manishearth/rust-clippy/issues/1245#issuecomment-250666810.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsE-mediumCall for participation: Medium difficulty level problem and requires some initial experience.T-ASTType: Requires working with the AST

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions