about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-29 20:20:25 +0000
committerbors <bors@rust-lang.org>2024-04-29 20:20:25 +0000
commit9e02abec3eb868bc61801b9f6439fde7b2499d22 (patch)
tree97fc6d07c935e526e4dd85809f71e0bb10035cdc
parent0fc9a65b8f161314dfc5016472d949b6b3986e22 (diff)
parentb700d9c9284a3a2423fb4cd26c31f86b6ca2f41d (diff)
downloadrust-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.rs2
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))
     });