Skip to content

Commit

Permalink
feat(config): Add unknown ruletype (#1741)
Browse files Browse the repository at this point in the history
Adds a new enum variant to ruletype for forward-compatibility

#1639
  • Loading branch information
TBS1996 authored Feb 1, 2023
1 parent cb60a65 commit 0151447
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions relay-general/src/pii/compiledconfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ fn collect_rules(
};
collect_rules(config, rules, &a.rule, parent);
}
RuleType::Unknown(_) => {}
_ => {
rules.insert(rule);
}
Expand Down
2 changes: 2 additions & 0 deletions relay-general/src/pii/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ pub enum RuleType {
Multiple(MultipleRule),
/// Applies another rule. Works like a single multiple.
Alias(AliasRule),
/// Unknown ruletype for forward compatibility
Unknown(String),
}

/// A single rule configuration.
Expand Down
2 changes: 1 addition & 1 deletion relay-general/src/pii/regexes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub fn get_regex_for_rule_type(
RuleType::Userpath => smallvec![(v, &*PATH_REGEX, ReplaceBehavior::replace_group(1))],

// These ought to have been resolved in CompiledConfig
RuleType::Alias(_) | RuleType::Multiple(_) => smallvec![],
RuleType::Alias(_) | RuleType::Multiple(_) | RuleType::Unknown(_) => smallvec![],
}
}

Expand Down

0 comments on commit 0151447

Please sign in to comment.