aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_cfg
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-04 19:00:17 +0100
committerGitHub <[email protected]>2020-07-04 19:00:17 +0100
commit4cfe0070dda16096c17c992ddb6c2d37b8ff4c39 (patch)
tree241c448b6c5781a703bad41d7fc0baf71acc7c31 /crates/ra_cfg
parentc815d5b49660e9b93c6a70039abef5fa02ae8013 (diff)
parent5b96d4103ea25a2dbb9811b082365ff77a89c94d (diff)
Merge #4864
4864: Add optional target to crates in json project r=Nashenas88 a=Nashenas88 Lookup default cfgs per target when generating cfg list. Should fully address #4840 CC @woody77 Co-authored-by: Paul Daniel Faria <[email protected]> Co-authored-by: Paul Daniel Faria <[email protected]>
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 57feabcb2..f9c73ece1 100644
--- a/crates/ra_cfg/src/lib.rs
+++ b/crates/ra_cfg/src/lib.rs
@@ -46,4 +46,14 @@ impl CfgOptions {
46 pub fn insert_key_value(&mut self, key: SmolStr, value: SmolStr) { 46 pub fn insert_key_value(&mut self, key: SmolStr, value: SmolStr) {
47 self.key_values.insert((key, value)); 47 self.key_values.insert((key, value));
48 } 48 }
49
50 pub fn append(&mut self, other: &CfgOptions) {
51 for atom in &other.atoms {
52 self.atoms.insert(atom.clone());
53 }
54
55 for (key, value) in &other.key_values {
56 self.key_values.insert((key.clone(), value.clone()));
57 }
58 }
49} 59}