aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_cfg
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_cfg')
-rw-r--r--crates/ra_cfg/src/lib.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/ra_cfg/src/lib.rs b/crates/ra_cfg/src/lib.rs
index dd81a73f4..e1c92fbba 100644
--- a/crates/ra_cfg/src/lib.rs
+++ b/crates/ra_cfg/src/lib.rs
@@ -1,4 +1,6 @@
1//! ra_cfg defines conditional compiling options, `cfg` attibute parser and evaluator 1//! ra_cfg defines conditional compiling options, `cfg` attibute parser and evaluator
2use std::iter::IntoIterator;
3
2use ra_syntax::SmolStr; 4use ra_syntax::SmolStr;
3use rustc_hash::FxHashSet; 5use rustc_hash::FxHashSet;
4 6
@@ -44,6 +46,14 @@ impl CfgOptions {
44 self 46 self
45 } 47 }
46 48
49 /// Shortcut to set features
50 pub fn features(mut self, iter: impl IntoIterator<Item = SmolStr>) -> CfgOptions {
51 for feat in iter {
52 self = self.key_value("feature".into(), feat);
53 }
54 self
55 }
56
47 pub fn remove_atom(mut self, name: &SmolStr) -> CfgOptions { 57 pub fn remove_atom(mut self, name: &SmolStr) -> CfgOptions {
48 self.atoms.remove(name); 58 self.atoms.remove(name);
49 self 59 self