fix(core): tighten policy verdicts
This commit is contained in:
@@ -112,14 +112,6 @@ pub enum HdrFormat {
|
|||||||
DolbyVision(DolbyVisionProfile),
|
DolbyVision(DolbyVisionProfile),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
|
||||||
pub enum HdrClaim {
|
|
||||||
Hdr10,
|
|
||||||
Hdr10Plus,
|
|
||||||
Hlg,
|
|
||||||
DolbyVision,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||||
pub enum RequiredAudio {
|
pub enum RequiredAudio {
|
||||||
OriginalLanguage,
|
OriginalLanguage,
|
||||||
@@ -204,9 +196,7 @@ pub enum Rule {
|
|||||||
RequiredAudio,
|
RequiredAudio,
|
||||||
DubBlacklist(Language),
|
DubBlacklist(Language),
|
||||||
DolbyVisionProfile(DolbyVisionProfile),
|
DolbyVisionProfile(DolbyVisionProfile),
|
||||||
ResolutionUnknown,
|
|
||||||
Resolution(Resolution),
|
Resolution(Resolution),
|
||||||
SourceUnknown,
|
|
||||||
Source(Source),
|
Source(Source),
|
||||||
Size,
|
Size,
|
||||||
Other(String),
|
Other(String),
|
||||||
|
|||||||
+101
-90
@@ -60,11 +60,38 @@ pub enum RuleOutcome {
|
|||||||
HardFail,
|
HardFail,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The result of evaluating one named rule.
|
/// A rule's identity when no violation exists to carry concrete evidence.
|
||||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||||
pub struct RuleEvaluation {
|
pub enum RuleKind {
|
||||||
pub rule: Rule,
|
RequiredAudio,
|
||||||
pub outcome: RuleOutcome,
|
DubBlacklist,
|
||||||
|
DolbyVisionProfile,
|
||||||
|
Resolution,
|
||||||
|
Source,
|
||||||
|
Size,
|
||||||
|
Other(String),
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The result of evaluating one rule.
|
||||||
|
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||||
|
pub enum RuleEvaluation {
|
||||||
|
Pass(RuleKind),
|
||||||
|
Unknown(RuleKind),
|
||||||
|
SoftFail(Rule),
|
||||||
|
HardFail(Rule),
|
||||||
|
}
|
||||||
|
|
||||||
|
impl RuleEvaluation {
|
||||||
|
/// The outcome category used by verdict reduction.
|
||||||
|
#[must_use]
|
||||||
|
pub const fn outcome(&self) -> RuleOutcome {
|
||||||
|
match self {
|
||||||
|
Self::Pass(_) => RuleOutcome::Pass,
|
||||||
|
Self::Unknown(_) => RuleOutcome::Unknown,
|
||||||
|
Self::SoftFail(_) => RuleOutcome::SoftFail,
|
||||||
|
Self::HardFail(_) => RuleOutcome::HardFail,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A policy rule that can participate in the verdict pipeline.
|
/// A policy rule that can participate in the verdict pipeline.
|
||||||
@@ -79,15 +106,9 @@ pub struct Evaluation {
|
|||||||
pub rules: Vec<RuleEvaluation>,
|
pub rules: Vec<RuleEvaluation>,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Apply the built-in filter rules and return the candidate's bucket.
|
/// Apply the built-in filter rules and retain the verdict and every rule result.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn evaluate(policy: &Policy, overrides: &MovieOverrides, candidate: Candidate<'_>) -> Verdict {
|
pub fn evaluate(
|
||||||
evaluate_with_report(policy, overrides, candidate).verdict
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Apply the built-in filter rules and retain each rule's result.
|
|
||||||
#[must_use]
|
|
||||||
pub fn evaluate_with_report(
|
|
||||||
policy: &Policy,
|
policy: &Policy,
|
||||||
overrides: &MovieOverrides,
|
overrides: &MovieOverrides,
|
||||||
candidate: Candidate<'_>,
|
candidate: Candidate<'_>,
|
||||||
@@ -104,20 +125,31 @@ pub fn evaluate_with_report(
|
|||||||
/// Reduce an ordered set of policy rules to a verdict.
|
/// Reduce an ordered set of policy rules to a verdict.
|
||||||
///
|
///
|
||||||
/// The first hard failure decides rejection. If none exists, the first soft
|
/// The first hard failure decides rejection. If none exists, the first soft
|
||||||
/// failure decides the waiver. Unknown evidence never becomes a pass.
|
/// failure decides the waiver. Unknown evaluations abstain from reduction and
|
||||||
|
/// remain visible in the returned report.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn evaluate_rules(context: &EvaluationContext<'_>, rules: &[&dyn PolicyRule]) -> Evaluation {
|
pub fn evaluate_rules(context: &EvaluationContext<'_>, rules: &[&dyn PolicyRule]) -> Evaluation {
|
||||||
let evaluations: Vec<RuleEvaluation> =
|
let evaluations: Vec<RuleEvaluation> =
|
||||||
rules.iter().map(|rule| rule.evaluate(context)).collect();
|
rules.iter().map(|rule| rule.evaluate(context)).collect();
|
||||||
|
|
||||||
let deciding_rule = |outcome| {
|
let hard_failure = evaluations.iter().find_map(|evaluation| {
|
||||||
evaluations
|
if let RuleEvaluation::HardFail(rule) = evaluation {
|
||||||
.iter()
|
Some(rule.clone())
|
||||||
.find(|evaluation| evaluation.outcome == outcome)
|
} else {
|
||||||
.map(|evaluation| evaluation.rule.clone())
|
None
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let soft_failure = || {
|
||||||
|
evaluations.iter().find_map(|evaluation| {
|
||||||
|
if let RuleEvaluation::SoftFail(rule) = evaluation {
|
||||||
|
Some(rule.clone())
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
})
|
||||||
};
|
};
|
||||||
let verdict = deciding_rule(RuleOutcome::HardFail).map_or_else(
|
let verdict = hard_failure.map_or_else(
|
||||||
|| deciding_rule(RuleOutcome::SoftFail).map_or(Verdict::Eligible, Verdict::Waived),
|
|| soft_failure().map_or(Verdict::Eligible, Verdict::Waived),
|
||||||
Verdict::Rejected,
|
Verdict::Rejected,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -134,25 +166,19 @@ pub struct ResolutionRule;
|
|||||||
impl PolicyRule for ResolutionRule {
|
impl PolicyRule for ResolutionRule {
|
||||||
fn evaluate(&self, context: &EvaluationContext<'_>) -> RuleEvaluation {
|
fn evaluate(&self, context: &EvaluationContext<'_>) -> RuleEvaluation {
|
||||||
let Some(resolution) = context.candidate.resolution() else {
|
let Some(resolution) = context.candidate.resolution() else {
|
||||||
return RuleEvaluation {
|
return RuleEvaluation::Unknown(RuleKind::Resolution);
|
||||||
rule: Rule::ResolutionUnknown,
|
|
||||||
outcome: RuleOutcome::Unknown,
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let accepted = context.policy.resolution_preference.contains(&resolution)
|
let allowed_by_root = context.policy.resolution_preference.contains(&resolution);
|
||||||
&& (!context.overrides.only_4k || resolution == Resolution::R2160p);
|
if allowed_by_root && (!context.overrides.only_4k || resolution == Resolution::R2160p) {
|
||||||
let outcome = if accepted {
|
RuleEvaluation::Pass(RuleKind::Resolution)
|
||||||
RuleOutcome::Pass
|
} else if allowed_by_root
|
||||||
} else if context.candidate.phase() == EvaluationPhase::PostDownload {
|
&& context.overrides.only_4k
|
||||||
RuleOutcome::SoftFail
|
&& context.candidate.phase() == EvaluationPhase::PostDownload
|
||||||
|
{
|
||||||
|
RuleEvaluation::SoftFail(Rule::Resolution(resolution))
|
||||||
} else {
|
} else {
|
||||||
RuleOutcome::HardFail
|
RuleEvaluation::HardFail(Rule::Resolution(resolution))
|
||||||
};
|
|
||||||
|
|
||||||
RuleEvaluation {
|
|
||||||
rule: Rule::Resolution(resolution),
|
|
||||||
outcome,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -164,26 +190,20 @@ pub struct SourceRule;
|
|||||||
impl PolicyRule for SourceRule {
|
impl PolicyRule for SourceRule {
|
||||||
fn evaluate(&self, context: &EvaluationContext<'_>) -> RuleEvaluation {
|
fn evaluate(&self, context: &EvaluationContext<'_>) -> RuleEvaluation {
|
||||||
let Some(source) = context.candidate.source() else {
|
let Some(source) = context.candidate.source() else {
|
||||||
return RuleEvaluation {
|
return RuleEvaluation::Unknown(RuleKind::Source);
|
||||||
rule: Rule::SourceUnknown,
|
|
||||||
outcome: RuleOutcome::Unknown,
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
let outcome = match source {
|
match source {
|
||||||
Source::Cam | Source::Telesync | Source::Screener => RuleOutcome::HardFail,
|
Source::Cam | Source::Telesync | Source::Screener => {
|
||||||
Source::Other => RuleOutcome::Unknown,
|
RuleEvaluation::HardFail(Rule::Source(source))
|
||||||
|
}
|
||||||
|
Source::Other => RuleEvaluation::Unknown(RuleKind::Source),
|
||||||
Source::Dvd
|
Source::Dvd
|
||||||
| Source::Telecine
|
| Source::Telecine
|
||||||
| Source::Hdtv
|
| Source::Hdtv
|
||||||
| Source::WebRip
|
| Source::WebRip
|
||||||
| Source::WebDl
|
| Source::WebDl
|
||||||
| Source::BluRay
|
| Source::BluRay
|
||||||
| Source::Remux => RuleOutcome::Pass,
|
| Source::Remux => RuleEvaluation::Pass(RuleKind::Source),
|
||||||
};
|
|
||||||
|
|
||||||
RuleEvaluation {
|
|
||||||
rule: Rule::Source(source),
|
|
||||||
outcome,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -230,11 +250,15 @@ mod tests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn verdict(policy: &Policy, overrides: &MovieOverrides, candidate: Candidate<'_>) -> Verdict {
|
||||||
|
evaluate(policy, overrides, candidate).verdict
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn missing_pre_grab_evidence_stays_unknown() {
|
fn missing_pre_grab_evidence_stays_unknown() {
|
||||||
let policy = policy();
|
let policy = policy();
|
||||||
let claims = claims(None, None);
|
let claims = claims(None, None);
|
||||||
let report = evaluate_with_report(
|
let report = evaluate(
|
||||||
&policy,
|
&policy,
|
||||||
&MovieOverrides::default(),
|
&MovieOverrides::default(),
|
||||||
Candidate::PreGrab(&claims),
|
Candidate::PreGrab(&claims),
|
||||||
@@ -244,14 +268,8 @@ mod tests {
|
|||||||
assert_eq!(
|
assert_eq!(
|
||||||
report.rules,
|
report.rules,
|
||||||
vec![
|
vec![
|
||||||
RuleEvaluation {
|
RuleEvaluation::Unknown(RuleKind::Resolution),
|
||||||
rule: Rule::ResolutionUnknown,
|
RuleEvaluation::Unknown(RuleKind::Source),
|
||||||
outcome: RuleOutcome::Unknown,
|
|
||||||
},
|
|
||||||
RuleEvaluation {
|
|
||||||
rule: Rule::SourceUnknown,
|
|
||||||
outcome: RuleOutcome::Unknown,
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -264,21 +282,21 @@ mod tests {
|
|||||||
for claimed in [ClaimedResolution::P2160, ClaimedResolution::P1080] {
|
for claimed in [ClaimedResolution::P2160, ClaimedResolution::P1080] {
|
||||||
let claims = claims(Some(claimed), Some(ClaimedSource::WebDl));
|
let claims = claims(Some(claimed), Some(ClaimedSource::WebDl));
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(&policy, &overrides, Candidate::PreGrab(&claims)),
|
verdict(&policy, &overrides, Candidate::PreGrab(&claims)),
|
||||||
Verdict::Eligible
|
Verdict::Eligible
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
for resolution in [Resolution::R2160p, Resolution::R1080p] {
|
for resolution in [Resolution::R2160p, Resolution::R1080p] {
|
||||||
let media = probed(resolution, Some(Source::WebDl));
|
let media = probed(resolution, Some(Source::WebDl));
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(&policy, &overrides, Candidate::PostDownload(&media)),
|
verdict(&policy, &overrides, Candidate::PostDownload(&media)),
|
||||||
Verdict::Eligible
|
Verdict::Eligible
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn every_disallowed_resolution_is_hard_before_grab_and_soft_after_download() {
|
fn resolution_outside_root_policy_hard_fails_in_both_phases() {
|
||||||
let policy = policy();
|
let policy = policy();
|
||||||
let overrides = MovieOverrides::default();
|
let overrides = MovieOverrides::default();
|
||||||
let cases = [
|
let cases = [
|
||||||
@@ -291,12 +309,12 @@ mod tests {
|
|||||||
let claims = claims(Some(claimed_resolution), Some(ClaimedSource::WebDl));
|
let claims = claims(Some(claimed_resolution), Some(ClaimedSource::WebDl));
|
||||||
let media = probed(resolution, Some(Source::WebDl));
|
let media = probed(resolution, Some(Source::WebDl));
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(&policy, &overrides, Candidate::PreGrab(&claims)),
|
verdict(&policy, &overrides, Candidate::PreGrab(&claims)),
|
||||||
Verdict::Rejected(Rule::Resolution(resolution))
|
Verdict::Rejected(Rule::Resolution(resolution))
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(&policy, &overrides, Candidate::PostDownload(&media)),
|
verdict(&policy, &overrides, Candidate::PostDownload(&media)),
|
||||||
Verdict::Waived(Rule::Resolution(resolution))
|
Verdict::Rejected(Rule::Resolution(resolution))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -312,17 +330,17 @@ mod tests {
|
|||||||
let media = probed(Resolution::R1080p, Some(Source::WebDl));
|
let media = probed(Resolution::R1080p, Some(Source::WebDl));
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(&policy, &overrides, Candidate::PreGrab(&claims_1080)),
|
verdict(&policy, &overrides, Candidate::PreGrab(&claims_1080)),
|
||||||
Verdict::Rejected(Rule::Resolution(Resolution::R1080p))
|
Verdict::Rejected(Rule::Resolution(Resolution::R1080p))
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(&policy, &overrides, Candidate::PostDownload(&media)),
|
verdict(&policy, &overrides, Candidate::PostDownload(&media)),
|
||||||
Verdict::Waived(Rule::Resolution(Resolution::R1080p))
|
Verdict::Waived(Rule::Resolution(Resolution::R1080p))
|
||||||
);
|
);
|
||||||
|
|
||||||
let claims = claims(Some(ClaimedResolution::P2160), Some(ClaimedSource::WebDl));
|
let claims = claims(Some(ClaimedResolution::P2160), Some(ClaimedSource::WebDl));
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(&policy, &overrides, Candidate::PreGrab(&claims)),
|
verdict(&policy, &overrides, Candidate::PreGrab(&claims)),
|
||||||
Verdict::Eligible
|
Verdict::Eligible
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -338,7 +356,7 @@ mod tests {
|
|||||||
let claims = claims(Some(ClaimedResolution::P2160), Some(ClaimedSource::WebDl));
|
let claims = claims(Some(ClaimedResolution::P2160), Some(ClaimedSource::WebDl));
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(&policy, &overrides, Candidate::PreGrab(&claims)),
|
verdict(&policy, &overrides, Candidate::PreGrab(&claims)),
|
||||||
Verdict::Rejected(Rule::Resolution(Resolution::R2160p))
|
Verdict::Rejected(Rule::Resolution(Resolution::R2160p))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -358,11 +376,11 @@ mod tests {
|
|||||||
let media = probed(Resolution::R2160p, Some(source));
|
let media = probed(Resolution::R2160p, Some(source));
|
||||||
let expected = Verdict::Rejected(Rule::Source(source));
|
let expected = Verdict::Rejected(Rule::Source(source));
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(&policy, &overrides, Candidate::PreGrab(&claims)),
|
verdict(&policy, &overrides, Candidate::PreGrab(&claims)),
|
||||||
expected
|
expected
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(&policy, &overrides, Candidate::PostDownload(&media)),
|
verdict(&policy, &overrides, Candidate::PostDownload(&media)),
|
||||||
expected
|
expected
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -374,7 +392,7 @@ mod tests {
|
|||||||
let claims = arr_parse::parse("Movie.2024.1080p.TS-GROUP");
|
let claims = arr_parse::parse("Movie.2024.1080p.TS-GROUP");
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(
|
verdict(
|
||||||
&policy,
|
&policy,
|
||||||
&MovieOverrides::default(),
|
&MovieOverrides::default(),
|
||||||
Candidate::PreGrab(&claims),
|
Candidate::PreGrab(&claims),
|
||||||
@@ -401,43 +419,40 @@ mod tests {
|
|||||||
let claims = claims(Some(ClaimedResolution::P2160), Some(claimed_source));
|
let claims = claims(Some(ClaimedResolution::P2160), Some(claimed_source));
|
||||||
let media = probed(Resolution::R2160p, Some(source));
|
let media = probed(Resolution::R2160p, Some(source));
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(&policy, &overrides, Candidate::PreGrab(&claims)),
|
verdict(&policy, &overrides, Candidate::PreGrab(&claims)),
|
||||||
Verdict::Eligible
|
Verdict::Eligible
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
evaluate(&policy, &overrides, Candidate::PostDownload(&media)),
|
verdict(&policy, &overrides, Candidate::PostDownload(&media)),
|
||||||
Verdict::Eligible
|
Verdict::Eligible
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unknown_post_download_source_is_not_treated_as_a_pass() {
|
fn unknown_post_download_source_is_preserved_in_report() {
|
||||||
let policy = policy();
|
let policy = policy();
|
||||||
for source in [None, Some(Source::Other)] {
|
for source in [None, Some(Source::Other)] {
|
||||||
let media = probed(Resolution::R2160p, source);
|
let media = probed(Resolution::R2160p, source);
|
||||||
let report = evaluate_with_report(
|
let report = evaluate(
|
||||||
&policy,
|
&policy,
|
||||||
&MovieOverrides::default(),
|
&MovieOverrides::default(),
|
||||||
Candidate::PostDownload(&media),
|
Candidate::PostDownload(&media),
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(report.rules[1].outcome, RuleOutcome::Unknown);
|
assert_eq!(report.verdict, Verdict::Eligible);
|
||||||
|
assert_eq!(report.rules[1], RuleEvaluation::Unknown(RuleKind::Source));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct FixedRule {
|
struct FixedRule {
|
||||||
rule: Rule,
|
evaluation: RuleEvaluation,
|
||||||
outcome: RuleOutcome,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PolicyRule for FixedRule {
|
impl PolicyRule for FixedRule {
|
||||||
fn evaluate(&self, _context: &EvaluationContext<'_>) -> RuleEvaluation {
|
fn evaluate(&self, _context: &EvaluationContext<'_>) -> RuleEvaluation {
|
||||||
RuleEvaluation {
|
self.evaluation.clone()
|
||||||
rule: self.rule.clone(),
|
|
||||||
outcome: self.outcome,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -452,12 +467,10 @@ mod tests {
|
|||||||
candidate: Candidate::PreGrab(&claims),
|
candidate: Candidate::PreGrab(&claims),
|
||||||
};
|
};
|
||||||
let soft = FixedRule {
|
let soft = FixedRule {
|
||||||
rule: Rule::Other("soft".to_owned()),
|
evaluation: RuleEvaluation::SoftFail(Rule::Other("soft".to_owned())),
|
||||||
outcome: RuleOutcome::SoftFail,
|
|
||||||
};
|
};
|
||||||
let hard = FixedRule {
|
let hard = FixedRule {
|
||||||
rule: Rule::Other("hard".to_owned()),
|
evaluation: RuleEvaluation::HardFail(Rule::Other("hard".to_owned())),
|
||||||
outcome: RuleOutcome::HardFail,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let report = evaluate_rules(&context, &[&soft, &hard]);
|
let report = evaluate_rules(&context, &[&soft, &hard]);
|
||||||
@@ -479,12 +492,10 @@ mod tests {
|
|||||||
candidate: Candidate::PreGrab(&claims),
|
candidate: Candidate::PreGrab(&claims),
|
||||||
};
|
};
|
||||||
let first = FixedRule {
|
let first = FixedRule {
|
||||||
rule: Rule::Other("first".to_owned()),
|
evaluation: RuleEvaluation::HardFail(Rule::Other("first".to_owned())),
|
||||||
outcome: RuleOutcome::HardFail,
|
|
||||||
};
|
};
|
||||||
let second = FixedRule {
|
let second = FixedRule {
|
||||||
rule: Rule::Other("second".to_owned()),
|
evaluation: RuleEvaluation::HardFail(Rule::Other("second".to_owned())),
|
||||||
outcome: RuleOutcome::HardFail,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let report = evaluate_rules(&context, &[&first, &second]);
|
let report = evaluate_rules(&context, &[&first, &second]);
|
||||||
|
|||||||
Reference in New Issue
Block a user