Use if-let guards in the codebase
This commit is contained in:
@@ -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();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user