mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-17 02:53:01 +00:00
Avoid parsing the root configuration twice (#10625)
This commit is contained in:
parent
068e22d382
commit
376fb71a7f
3 changed files with 37 additions and 30 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue