aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r--crates/hir/src/lib.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 88490fea9..2b2aaec94 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -233,6 +233,10 @@ impl Crate {
233 pub fn cfg(&self, db: &dyn HirDatabase) -> CfgOptions { 233 pub fn cfg(&self, db: &dyn HirDatabase) -> CfgOptions {
234 db.crate_graph()[self.id].cfg_options.clone() 234 db.crate_graph()[self.id].cfg_options.clone()
235 } 235 }
236
237 pub fn features(&self, db: &dyn HirDatabase) -> Vec<String> {
238 db.crate_graph()[self.id].features.iter().map(|(feat, _)| feat.clone()).collect()
239 }
236} 240}
237 241
238#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 242#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]