diff options
| author | bors <bors@rust-lang.org> | 2024-04-29 20:20:25 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-29 20:20:25 +0000 |
| commit | 9e02abec3eb868bc61801b9f6439fde7b2499d22 (patch) | |
| tree | 97fc6d07c935e526e4dd85809f71e0bb10035cdc | |
| parent | 0fc9a65b8f161314dfc5016472d949b6b3986e22 (diff) | |
| parent | b700d9c9284a3a2423fb4cd26c31f86b6ca2f41d (diff) | |
| download | rust-9e02abec3eb868bc61801b9f6439fde7b2499d22.tar.gz rust-9e02abec3eb868bc61801b9f6439fde7b2499d22.zip | |
Auto merge of #12726 - kornelski:else_applicable, r=blyxyas
clippy::single_match(_else) may be machine applicable ``` changelog: [`single_match`]: make the lint machine-applicable changelog: [`single_match_else`]: make the lint machine-applicable ``` --- The lint doesn't use placeholders. I've tried it on my codebases, and all instances of it applied without problems.
| -rw-r--r-- | clippy_lints/src/matches/single_match.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/matches/single_match.rs b/clippy_lints/src/matches/single_match.rs index a0db8e2db1f..98dbe3c4f00 100644 --- a/clippy_lints/src/matches/single_match.rs +++ b/clippy_lints/src/matches/single_match.rs @@ -75,7 +75,7 @@ fn report_single_pattern( ) { let lint = if els.is_some() { SINGLE_MATCH_ELSE } else { SINGLE_MATCH }; let ctxt = expr.span.ctxt(); - let mut app = Applicability::HasPlaceholders; + let mut app = Applicability::MachineApplicable; let els_str = els.map_or(String::new(), |els| { format!(" else {}", expr_block(cx, els, ctxt, "..", Some(expr.span), &mut app)) }); |
