Use if-let guards in the codebase
This commit is contained in:
parent
a992a11913
commit
fde1b76b4b
27 changed files with 242 additions and 254 deletions
|
@ -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();
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue