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 0aeb0b0505..8bbe5e2a8c 100644 --- a/crates/cfg/src/lib.rs +++ b/crates/cfg/src/lib.rs @@ -58,6 +58,13 @@ impl CfgOptions { self.enabled.insert(CfgAtom::KeyValue { key, value }); } + pub fn difference<'a>( + &'a self, + other: &'a CfgOptions, + ) -> impl Iterator<Item = &'a CfgAtom> + 'a { + self.enabled.difference(&other.enabled) + } + pub fn apply_diff(&mut self, diff: CfgDiff) { for atom in diff.enable { self.enabled.insert(atom); |