aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_cfg/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_cfg/src/lib.rs')
-rw-r--r--crates/ra_cfg/src/lib.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/crates/ra_cfg/src/lib.rs b/crates/ra_cfg/src/lib.rs
index f9c73ece1..cd5a0a7b6 100644
--- a/crates/ra_cfg/src/lib.rs
+++ b/crates/ra_cfg/src/lib.rs
@@ -5,7 +5,7 @@ mod cfg_expr;
5use ra_syntax::SmolStr; 5use ra_syntax::SmolStr;
6use rustc_hash::FxHashSet; 6use rustc_hash::FxHashSet;
7 7
8pub use cfg_expr::{parse_cfg, CfgExpr}; 8pub use cfg_expr::CfgExpr;
9 9
10/// Configuration options used for conditional compilition on items with `cfg` attributes. 10/// Configuration options used for conditional compilition on items with `cfg` attributes.
11/// We have two kind of options in different namespaces: atomic options like `unix`, and 11/// We have two kind of options in different namespaces: atomic options like `unix`, and
@@ -31,18 +31,10 @@ impl CfgOptions {
31 }) 31 })
32 } 32 }
33 33
34 pub fn is_cfg_enabled(&self, attr: &tt::Subtree) -> Option<bool> {
35 self.check(&parse_cfg(attr))
36 }
37
38 pub fn insert_atom(&mut self, key: SmolStr) { 34 pub fn insert_atom(&mut self, key: SmolStr) {
39 self.atoms.insert(key); 35 self.atoms.insert(key);
40 } 36 }
41 37
42 pub fn remove_atom(&mut self, name: &str) {
43 self.atoms.remove(name);
44 }
45
46 pub fn insert_key_value(&mut self, key: SmolStr, value: SmolStr) { 38 pub fn insert_key_value(&mut self, key: SmolStr, value: SmolStr) {
47 self.key_values.insert((key, value)); 39 self.key_values.insert((key, value));
48 } 40 }