aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres/collector.rs
diff options
context:
space:
mode:
authoruHOOCCOOHu <[email protected]>2019-10-02 18:38:56 +0100
committeruHOOCCOOHu <[email protected]>2019-10-02 19:28:03 +0100
commite0100e63ae2e873f119b905ac77c3355ffb351b0 (patch)
tree25d799c1e52a32af80f603f4e6103e0969c5b6a8 /crates/ra_hir/src/nameres/collector.rs
parent43f09ad36ccc1c53c78a66274693e53161c9b2fa (diff)
Optimize
Diffstat (limited to 'crates/ra_hir/src/nameres/collector.rs')
-rw-r--r--crates/ra_hir/src/nameres/collector.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/ra_hir/src/nameres/collector.rs b/crates/ra_hir/src/nameres/collector.rs
index 1d79cbd8c..cef2dc9d2 100644
--- a/crates/ra_hir/src/nameres/collector.rs
+++ b/crates/ra_hir/src/nameres/collector.rs
@@ -7,7 +7,6 @@ use rustc_hash::FxHashMap;
7use test_utils::tested_by; 7use test_utils::tested_by;
8 8
9use crate::{ 9use crate::{
10 attr::Attr,
11 db::DefDatabase, 10 db::DefDatabase,
12 ids::{AstItemDef, LocationCtx, MacroCallId, MacroCallLoc, MacroDefId, MacroFileKind}, 11 ids::{AstItemDef, LocationCtx, MacroCallId, MacroCallLoc, MacroDefId, MacroFileKind},
13 name::MACRO_RULES, 12 name::MACRO_RULES,
@@ -715,8 +714,12 @@ where
715 } 714 }
716 } 715 }
717 716
718 fn is_cfg_enabled(&self, attrs: &[Attr]) -> bool { 717 fn is_cfg_enabled(&self, attrs: &raw::Attrs) -> bool {
719 attrs.iter().all(|attr| attr.is_cfg_enabled(&self.def_collector.cfg_options) != Some(false)) 718 attrs.as_ref().map_or(true, |attrs| {
719 attrs
720 .iter()
721 .all(|attr| attr.is_cfg_enabled(&self.def_collector.cfg_options) != Some(false))
722 })
720 } 723 }
721} 724}
722 725