mirror of
https://github.com/openai/codex.git
synced 2026-05-02 12:21:26 +03:00
implementing PartialOrd for Decision instead of defining custom is_stricter_than func
This commit is contained in:
@@ -42,13 +42,7 @@ impl Policy {
|
||||
if let Some(matched) = rule.matches(cmd) {
|
||||
let decision = match best_decision {
|
||||
None => matched.decision,
|
||||
Some(current) => {
|
||||
if matched.decision.is_stricter_than(current) {
|
||||
matched.decision
|
||||
} else {
|
||||
current
|
||||
}
|
||||
}
|
||||
Some(current) => std::cmp::max(matched.decision, current),
|
||||
};
|
||||
best_decision = Some(decision);
|
||||
matched_rules.push(matched);
|
||||
|
||||
Reference in New Issue
Block a user