diff options
author | Paul Daniel Faria <[email protected]> | 2020-06-12 18:08:51 +0100 |
---|---|---|
committer | Paul Daniel Faria <[email protected]> | 2020-07-04 18:49:44 +0100 |
commit | db99f2dd7e8e244b858926bbf1d2a49e25f44733 (patch) | |
tree | 8c57a0a494e1a6e6250b5081276f57e8467a92cd /crates/ra_cfg | |
parent | c815d5b49660e9b93c6a70039abef5fa02ae8013 (diff) |
Add optional target to crates in json project, lookup default cfgs per target when generating cfg list
Diffstat (limited to 'crates/ra_cfg')
-rw-r--r-- | crates/ra_cfg/src/lib.rs | 10 |
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 | } |