about summary refs log tree commit diff
path: root/clippy_lints/src/unnested_or_patterns.rs
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2022-10-20 16:39:27 +0200
committerPhilipp Krones <hello@philkrones.com>2022-10-20 16:39:27 +0200
commitfb8ecb983258aafdf0e8a56c565a615e1e1dafb4 (patch)
treeeb0955692c1bd56ac0ffefdbbcdb8bcc2653f104 /clippy_lints/src/unnested_or_patterns.rs
parent4f50e6f41ec8b55a6dc52066dc15fa5d17b8e39b (diff)
parent1afc7e227de5453ba98212f82c892522068ea830 (diff)
downloadrust-fb8ecb983258aafdf0e8a56c565a615e1e1dafb4.tar.gz
rust-fb8ecb983258aafdf0e8a56c565a615e1e1dafb4.zip
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'clippy_lints/src/unnested_or_patterns.rs')
-rw-r--r--clippy_lints/src/unnested_or_patterns.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/clippy_lints/src/unnested_or_patterns.rs b/clippy_lints/src/unnested_or_patterns.rs
index fb73c386640..b305dae7608 100644
--- a/clippy_lints/src/unnested_or_patterns.rs
+++ b/clippy_lints/src/unnested_or_patterns.rs
@@ -163,9 +163,8 @@ fn unnest_or_patterns(pat: &mut P<Pat>) -> bool {
             noop_visit_pat(p, self);
 
             // Don't have an or-pattern? Just quit early on.
-            let alternatives = match &mut p.kind {
-                Or(ps) => ps,
-                _ => return,
+            let Or(alternatives) = &mut p.kind else {
+                return
             };
 
             // Collapse or-patterns directly nested in or-patterns.