Avoid parsing the root configuration twice (#10625)

This commit is contained in:
Micha Reiser 2024-05-01 11:28:30 +02:00 committed by GitHub
parent 068e22d382
commit 376fb71a7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 30 deletions

View file

@ -207,6 +207,15 @@ impl RuleSet {
*self = set.union(&RuleSet::from_rule(rule));
}
#[inline]
pub fn set(&mut self, rule: Rule, enabled: bool) {
if enabled {
self.insert(rule);
} else {
self.remove(rule);
}
}
/// Removes `rule` from the set.
///
/// ## Examples