Skip to content

Commit

Permalink
Auto merge of rust-lang#12726 - kornelski:else_applicable, r=blyxyas
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Apr 29, 2024
2 parents 0fc9a65 + b700d9c commit 9e02abe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clippy_lints/src/matches/single_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
});
Expand Down

0 comments on commit 9e02abe

Please sign in to comment.