Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/cfg/src/lib.rs')
| -rw-r--r-- | crates/cfg/src/lib.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/cfg/src/lib.rs b/crates/cfg/src/lib.rs index 906106ca5d..b1ec4c273a 100644 --- a/crates/cfg/src/lib.rs +++ b/crates/cfg/src/lib.rs @@ -115,6 +115,13 @@ impl CfgOptions { pub fn shrink_to_fit(&mut self) { self.enabled.shrink_to_fit(); } + + pub fn append(&mut self, other: CfgOptions) { + // Do not call `insert_any_atom()`, as it'll check for `true` and `false`, but this is not + // needed since we already checked for that when constructing `other`. Furthermore, this + // will always err, as `other` inevitably contains `true` (just as we do). + self.enabled.extend(other.enabled); + } } impl Extend<CfgAtom> for CfgOptions { |