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.
This commit is contained in:
bors 2024-04-29 20:20:25 +00:00
commit 9e02abec3e

View File

@ -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))
});