]> git.lizzy.rs Git - rust.git/commitdiff
Simplify attr_is_cfg in returns.rs
authorEnrico Schmitz <enrico@schmitz.link>
Mon, 20 Mar 2017 23:34:05 +0000 (00:34 +0100)
committerEnrico Schmitz <enrico@schmitz.link>
Mon, 20 Mar 2017 23:34:05 +0000 (00:34 +0100)
clippy_lints/src/returns.rs

index a2639d355266a3bfb0d6c6a5b1ad288099f2dad9..031e3f8cf2ca2d0a4580140b6323d7968a1c3ec4 100644 (file)
@@ -150,9 +150,5 @@ fn check_block(&mut self, cx: &EarlyContext, block: &ast::Block) {
 }
 
 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")
 }