Skip to content

redundant_pattern_matching does not check for match with single arm #10726

@disco07

Description

@disco07

Summary

Use of match, matching Result or Option; do not trigger clippy::redundant_pattern_matching

Reproducer

I tried this code:

match Err::<i32, i32>(55) { Ok(_) => true, _ => false, };

I expected to see this happen:

Err::<i32, i32>(55).is_ok();

Instead, this happened:

match Err::<i32, i32>(55) { Ok(_) => true, _ => false, };

Version

rustc 1.71.0-nightly (b628260df 2023-04-22) binary: rustc commit-hash: b628260df0587ae559253d8640ecb8738d3de613 commit-date: 2023-04-22 host: x86_64-unknown-linux-gnu release: 1.71.0-nightly LLVM version: 16.0.2 

Additional Labels

No response

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions