Simplify attr_is_cfg in returns.rs

This commit is contained in:
Enrico Schmitz 2017-03-21 00:34:05 +01:00
parent f8df4aed0f
commit fa0a670201

View file

@ -150,9 +150,5 @@ impl EarlyLintPass for ReturnPass {
}
fn attr_is_cfg(attr: &ast::Attribute) -> bool {
if attr.meta_item_list().is_some() {
attr.name().map_or(false, |n| n == "cfg")
} else {
false
}
attr.meta_item_list().is_some() && attr.name().map_or(false, |n| n == "cfg")
}