From db99f2dd7e8e244b858926bbf1d2a49e25f44733 Mon Sep 17 00:00:00 2001 From: Paul Daniel Faria Date: Fri, 12 Jun 2020 13:08:51 -0400 Subject: Add optional target to crates in json project, lookup default cfgs per target when generating cfg list --- crates/ra_cfg/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'crates/ra_cfg') 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 { pub fn insert_key_value(&mut self, key: SmolStr, value: SmolStr) { self.key_values.insert((key, value)); } + + pub fn append(&mut self, other: &CfgOptions) { + for atom in &other.atoms { + self.atoms.insert(atom.clone()); + } + + for (key, value) in &other.key_values { + self.key_values.insert((key.clone(), value.clone())); + } + } } -- cgit v1.2.3