mirror of
https://github.com/openai/codex.git
synced 2026-04-30 01:16:54 +00:00
conslidate validate_match_examples and validate_not_match_examples
This commit is contained in:
@@ -18,6 +18,7 @@ use crate::decision::Decision;
|
||||
use crate::error::Error;
|
||||
use crate::error::Result;
|
||||
use crate::policy::validate_match_examples;
|
||||
use crate::policy::validate_not_match_examples;
|
||||
use crate::rule::PatternToken;
|
||||
use crate::rule::PrefixPattern;
|
||||
use crate::rule::PrefixRule;
|
||||
@@ -228,10 +229,7 @@ fn policy_builtins(builder: &mut GlobalsBuilder) {
|
||||
})
|
||||
.collect();
|
||||
|
||||
rules
|
||||
.iter()
|
||||
.try_for_each(|rule| rule.validate_not_matches(¬_matches))?;
|
||||
|
||||
validate_not_match_examples(&rules, ¬_matches)?;
|
||||
validate_match_examples(&rules, &matches)?;
|
||||
|
||||
rules.into_iter().for_each(|rule| builder.add_rule(rule));
|
||||
|
||||
Reference in New Issue
Block a user