about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/validate_attr.rs
diff options
context:
space:
mode:
authorLéo Lanteri Thauvin <leseulartichaut@gmail.com>2021-08-16 17:29:49 +0200
committerLéo Lanteri Thauvin <leseulartichaut@gmail.com>2021-08-25 20:24:35 +0200
commitfde1b76b4b1d0d84f5691f4785906b31bb91f38d (patch)
tree966691ff24d8ec26354d737e549bbfccaa658f3d /compiler/rustc_parse/src/validate_attr.rs
parenta992a11913b39a258158646bb1e03528c5aa5060 (diff)
downloadrust-fde1b76b4b1d0d84f5691f4785906b31bb91f38d.tar.gz
rust-fde1b76b4b1d0d84f5691f4785906b31bb91f38d.zip
Use if-let guards in the codebase
Diffstat (limited to 'compiler/rustc_parse/src/validate_attr.rs')
-rw-r--r--compiler/rustc_parse/src/validate_attr.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/compiler/rustc_parse/src/validate_attr.rs b/compiler/rustc_parse/src/validate_attr.rs
index 21372725a68..67695dc2850 100644
--- a/compiler/rustc_parse/src/validate_attr.rs
+++ b/compiler/rustc_parse/src/validate_attr.rs
@@ -24,16 +24,15 @@ pub fn check_meta(sess: &ParseSess, attr: &Attribute) {
         Some((name, _, template, _)) if name != sym::rustc_dummy => {
             check_builtin_attribute(sess, attr, name, template)
         }
-        _ => {
-            if let MacArgs::Eq(..) = attr.get_normal_item().args {
-                // All key-value attributes are restricted to meta-item syntax.
-                parse_meta(sess, attr)
-                    .map_err(|mut err| {
-                        err.emit();
-                    })
-                    .ok();
-            }
+        _ if let MacArgs::Eq(..) = attr.get_normal_item().args => {
+            // All key-value attributes are restricted to meta-item syntax.
+            parse_meta(sess, attr)
+                .map_err(|mut err| {
+                    err.emit();
+                })
+                .ok();
         }
+        _ => {}
     }
 }