mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
v3
This commit is contained in:
parent
7e4aad5ba5
commit
25e990d753
2 changed files with 50 additions and 66 deletions
|
@ -7,7 +7,7 @@ mod dnf;
|
|||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use std::fmt;
|
||||
use std::{collections::HashSet, fmt};
|
||||
|
||||
use rustc_hash::FxHashSet;
|
||||
use tt::SmolStr;
|
||||
|
@ -58,6 +58,10 @@ impl CfgOptions {
|
|||
self.enabled.insert(CfgAtom::KeyValue { key, value });
|
||||
}
|
||||
|
||||
pub fn diff<'a>(&'a self, other: &'a CfgOptions) -> HashSet<&CfgAtom> {
|
||||
self.enabled.difference(&other.enabled).collect()
|
||||
}
|
||||
|
||||
pub fn apply_diff(&mut self, diff: CfgDiff) {
|
||||
for atom in diff.enable {
|
||||
self.enabled.insert(atom);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue