aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/attr.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-24 12:28:45 +0000
committerAleksey Kladov <[email protected]>2019-11-24 12:28:45 +0000
commit8e36cb586038e2c12e6eceae57f7a95684fc6c6d (patch)
tree178c95a19df6a463e0db472b51123355f794ad90 /crates/ra_hir_def/src/attr.rs
parent151180057b0304ee4dee75401e8f1aaa7aaaec21 (diff)
Simplify
Diffstat (limited to 'crates/ra_hir_def/src/attr.rs')
-rw-r--r--crates/ra_hir_def/src/attr.rs12
1 files changed, 1 insertions, 11 deletions
diff --git a/crates/ra_hir_def/src/attr.rs b/crates/ra_hir_def/src/attr.rs
index 87f411599..7d8f0d915 100644
--- a/crates/ra_hir_def/src/attr.rs
+++ b/crates/ra_hir_def/src/attr.rs
@@ -144,17 +144,7 @@ impl Attr {
144 } 144 }
145 } 145 }
146 146
147 pub fn as_path(&self) -> Option<&SmolStr> { 147 pub(crate) fn is_cfg_enabled(&self, cfg_options: &CfgOptions) -> Option<bool> {
148 if !self.is_simple_atom("path") {
149 return None;
150 }
151 match &self.input {
152 Some(AttrInput::Literal(it)) => Some(it),
153 _ => None,
154 }
155 }
156
157 pub fn is_cfg_enabled(&self, cfg_options: &CfgOptions) -> Option<bool> {
158 cfg_options.is_cfg_enabled(self.as_cfg()?) 148 cfg_options.is_cfg_enabled(self.as_cfg()?)
159 } 149 }
160} 150}